mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-14 09:11:27 +00:00
dev_handlers: Remove support for kernel versions before 3.10
The SCST has dropped support for kernels older than 3.10.0 (RHEL 7 / Centos 7) since SCST v3.6
This commit is contained in:
committed by
Gleb Chesnokov
parent
0a1b23a453
commit
1fd799f3ab
@@ -83,12 +83,7 @@ static int changer_attach(struct scst_device *dev)
|
||||
do {
|
||||
TRACE_DBG("%s", "Doing TEST_UNIT_READY");
|
||||
rc = scsi_test_unit_ready(dev->scsi_dev,
|
||||
SCST_GENERIC_CHANGER_TIMEOUT, CHANGER_RETRIES
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
|
||||
);
|
||||
#else
|
||||
, NULL);
|
||||
#endif
|
||||
SCST_GENERIC_CHANGER_TIMEOUT, CHANGER_RETRIES, NULL);
|
||||
TRACE_DBG("TEST_UNIT_READY done: %x", rc);
|
||||
} while ((--retries > 0) && rc);
|
||||
|
||||
|
||||
@@ -200,8 +200,6 @@ static int disk_done(struct scst_cmd *cmd)
|
||||
return res;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
|
||||
|
||||
static bool disk_on_sg_tablesize_low(struct scst_cmd *cmd)
|
||||
{
|
||||
bool res;
|
||||
@@ -466,7 +464,6 @@ out_error:
|
||||
goto out_done;
|
||||
}
|
||||
|
||||
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30) */
|
||||
|
||||
static enum scst_exec_res disk_perf_exec(struct scst_cmd *cmd)
|
||||
{
|
||||
@@ -517,10 +514,8 @@ static struct scst_dev_type disk_devtype = {
|
||||
.attach = disk_attach,
|
||||
.detach = disk_detach,
|
||||
.parse = disk_parse,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
|
||||
.exec = disk_exec,
|
||||
.on_sg_tablesize_low = disk_on_sg_tablesize_low,
|
||||
#endif
|
||||
.dev_done = disk_done,
|
||||
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
|
||||
.default_trace_flags = SCST_DEFAULT_DEV_LOG_FLAGS,
|
||||
@@ -538,9 +533,7 @@ static struct scst_dev_type disk_devtype_perf = {
|
||||
.parse = disk_parse,
|
||||
.exec = disk_perf_exec,
|
||||
.dev_done = disk_done,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)
|
||||
.on_sg_tablesize_low = disk_on_sg_tablesize_low,
|
||||
#endif
|
||||
#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING)
|
||||
.default_trace_flags = SCST_DEFAULT_DEV_LOG_FLAGS,
|
||||
.trace_flags = &trace_flag,
|
||||
|
||||
@@ -83,12 +83,7 @@ static int processor_attach(struct scst_device *dev)
|
||||
do {
|
||||
TRACE_DBG("%s", "Doing TEST_UNIT_READY");
|
||||
rc = scsi_test_unit_ready(dev->scsi_dev,
|
||||
SCST_GENERIC_PROCESSOR_TIMEOUT, PROCESSOR_RETRIES
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
|
||||
);
|
||||
#else
|
||||
, NULL);
|
||||
#endif
|
||||
SCST_GENERIC_PROCESSOR_TIMEOUT, PROCESSOR_RETRIES, NULL);
|
||||
TRACE_DBG("TEST_UNIT_READY done: %x", rc);
|
||||
} while ((--retries > 0) && rc);
|
||||
|
||||
|
||||
@@ -83,12 +83,7 @@ static int raid_attach(struct scst_device *dev)
|
||||
do {
|
||||
TRACE_DBG("%s", "Doing TEST_UNIT_READY");
|
||||
rc = scsi_test_unit_ready(dev->scsi_dev,
|
||||
SCST_GENERIC_RAID_TIMEOUT, RAID_RETRIES
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
|
||||
);
|
||||
#else
|
||||
, NULL);
|
||||
#endif
|
||||
SCST_GENERIC_RAID_TIMEOUT, RAID_RETRIES, NULL);
|
||||
TRACE_DBG("TEST_UNIT_READY done: %x", rc);
|
||||
} while ((--retries > 0) && rc);
|
||||
|
||||
|
||||
@@ -159,12 +159,7 @@ static int tape_attach(struct scst_device *dev)
|
||||
do {
|
||||
TRACE_DBG("%s", "Doing TEST_UNIT_READY");
|
||||
rc = scsi_test_unit_ready(dev->scsi_dev,
|
||||
SCST_GENERIC_TAPE_SMALL_TIMEOUT, TAPE_RETRIES
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
|
||||
);
|
||||
#else
|
||||
, NULL);
|
||||
#endif
|
||||
SCST_GENERIC_TAPE_SMALL_TIMEOUT, TAPE_RETRIES, NULL);
|
||||
TRACE_DBG("TEST_UNIT_READY done: %x", rc);
|
||||
} while ((--retries > 0) && rc);
|
||||
|
||||
|
||||
@@ -4120,11 +4120,7 @@ static int __init init_scst_user(void)
|
||||
struct scst_user_reply_cmd r;
|
||||
};
|
||||
};
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21)
|
||||
struct class_device *class_member;
|
||||
#else
|
||||
struct device *dev;
|
||||
#endif
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
@@ -4174,25 +4170,14 @@ static int __init init_scst_user(void)
|
||||
goto out_class;
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21)
|
||||
class_member = class_device_create(dev_user_sysfs_class, NULL,
|
||||
MKDEV(dev_user_major, 0), NULL, DEV_USER_NAME);
|
||||
if (IS_ERR(class_member)) {
|
||||
res = PTR_ERR(class_member);
|
||||
goto out_chrdev;
|
||||
}
|
||||
#else
|
||||
dev = device_create(dev_user_sysfs_class, NULL,
|
||||
MKDEV(dev_user_major, 0),
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
|
||||
NULL,
|
||||
#endif
|
||||
DEV_USER_NAME);
|
||||
if (IS_ERR(dev)) {
|
||||
res = PTR_ERR(dev);
|
||||
goto out_chrdev;
|
||||
}
|
||||
#endif
|
||||
|
||||
cleanup_thread = kthread_run(dev_user_cleanup_thread, NULL,
|
||||
"scst_usr_cleanupd");
|
||||
@@ -4207,11 +4192,7 @@ out:
|
||||
return res;
|
||||
|
||||
out_dev:
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21)
|
||||
class_device_destroy(dev_user_sysfs_class, MKDEV(dev_user_major, 0));
|
||||
#else
|
||||
device_destroy(dev_user_sysfs_class, MKDEV(dev_user_major, 0));
|
||||
#endif
|
||||
|
||||
out_chrdev:
|
||||
unregister_chrdev(dev_user_major, DEV_USER_NAME);
|
||||
@@ -4242,11 +4223,7 @@ static void __exit exit_scst_user(void)
|
||||
TRACE_MGMT_DBG("kthread_stop() failed: %d", rc);
|
||||
|
||||
unregister_chrdev(dev_user_major, DEV_USER_NAME);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 21)
|
||||
class_device_destroy(dev_user_sysfs_class, MKDEV(dev_user_major, 0));
|
||||
#else
|
||||
device_destroy(dev_user_sysfs_class, MKDEV(dev_user_major, 0));
|
||||
#endif
|
||||
class_destroy(dev_user_sysfs_class);
|
||||
|
||||
scst_unregister_virtual_dev_driver(&dev_user_devtype);
|
||||
|
||||
Reference in New Issue
Block a user