diff --git a/scst/include/backport.h b/scst/include/backport.h index eec927283..98b21fd60 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -348,6 +348,24 @@ static inline int __must_check kref_get_unless_zero(struct kref *kref) } #endif +/* */ + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0) && \ + LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)) && \ + (!defined(RHEL_MAJOR) || RHEL_MAJOR -0 < 7) +/** + * ktime_before - Compare if a ktime_t value is smaller than another one. + * @cmp1: comparable1 + * @cmp2: comparable2 + * + * Return: true if cmp1 happened before cmp2. + */ +static inline bool ktime_before(const ktime_t cmp1, const ktime_t cmp2) +{ + return ktime_compare(cmp1, cmp2) < 0; +} +#endif + /* */ #ifndef __list_for_each @@ -678,19 +696,4 @@ static inline int scsi_bidi_cmnd(struct scsi_cmnd *cmd) } #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)) && \ - (LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)) -/** - * ktime_before - Compare if a ktime_t value is smaller than another one. - * @cmp1: comparable1 - * @cmp2: comparable2 - * - * Return: true if cmp1 happened before cmp2. - */ -static inline bool ktime_before(const ktime_t cmp1, const ktime_t cmp2) -{ - return ktime_compare(cmp1, cmp2) < 0; -} -#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 9, 0)) && (LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)) */ - #endif /* _SCST_BACKPORT_H_ */ diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index e0bd9bedc..d59aa482f 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -631,6 +631,7 @@ static const struct attribute *vdisk_nullio_attrs[] = { &vdev_dummy_attr.attr, &vdev_read_zero_attr.attr, &vdisk_removable_attr.attr, + &vdisk_cluster_mode_attr.attr, &vdev_t10_vend_id_attr.attr, &vdev_vend_specific_id_attr.attr, &vdev_prod_id_attr.attr, @@ -831,6 +832,7 @@ static struct scst_dev_type vdisk_null_devtype = { "dif_mode, " "dif_type, " "dif_static_app_tag, ", + "cluster_mode, " "read_only, " "removable, " "rotational, " @@ -8180,7 +8182,7 @@ static int vdev_nullio_add_device(const char *device_name, char *params) int res = 0; static const char *const allowed_params[] = { "read_only", "dummy", "removable", "blocksize", "rotational", - "dif_mode", "dif_type", "dif_static_app_tag", + "cluster_mode", "dif_mode", "dif_type", "dif_static_app_tag", "size", "size_mb", "tst", NULL }; struct scst_vdisk_dev *virt_dev; diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index d9871a3f9..7c6fdf46e 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -2191,7 +2191,7 @@ static int scst_process_ini_group_mgmt_store(char *buffer, TRACE_DBG("Creating group '%s'", p); if (acg != NULL) { PRINT_ERROR("acg name %s exist", p); - res = -EINVAL; + res = -EEXIST; goto out_unlock; } res = scst_alloc_add_acg(tgt, p, true, &acg);