mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-17 04:36:22 +00:00
scst: Use separate sysfs_emit_at() for emitting SCST_SYSFS_KEY_MARK
Replace combined sysfs_emit() calls with separate sysfs_emit() and sysfs_emit_at() invocations when emitting SCST_SYSFS_KEY_MARK in sysfs attribute show handlers. This improves code clarity and consistency, explicitly handling the conditional addition of SCST_SYSFS_KEY_MARK. This patch does not change any functionality.
This commit is contained in:
@@ -577,8 +577,10 @@ static ssize_t iscsi_acg_sess_dedicated_threads_show(struct kobject *kobj,
|
||||
acg = container_of(kobj, struct scst_acg, acg_kobj);
|
||||
dedicated = scst_get_acg_tgt_priv(acg);
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
dedicated, dedicated ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", dedicated);
|
||||
|
||||
if (dedicated)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
|
||||
@@ -1086,16 +1086,19 @@ static ssize_t sqa_show_expl_conf_enabled(struct kobject *kobj,
|
||||
struct sqa_scst_tgt *sqa_tgt;
|
||||
struct qla_tgt *tgt;
|
||||
struct qla_hw_data *ha;
|
||||
ssize_t ret;
|
||||
|
||||
scst_tgt = container_of(kobj, struct scst_tgt, tgt_kobj);
|
||||
sqa_tgt = scst_tgt_get_tgt_priv(scst_tgt);
|
||||
tgt = sqa_tgt->qla_tgt;
|
||||
ha = tgt->ha;
|
||||
|
||||
return sysfs_emit(buffer, "%d\n%s",
|
||||
ha->base_qpair->enable_explicit_conf,
|
||||
ha->base_qpair->enable_explicit_conf ?
|
||||
SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buffer, "%d\n", ha->base_qpair->enable_explicit_conf);
|
||||
|
||||
if (ha->base_qpair->enable_explicit_conf)
|
||||
ret += sysfs_emit_at(buffer, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t sqa_store_expl_conf_enabled(struct kobject *kobj,
|
||||
|
||||
@@ -6616,9 +6616,10 @@ static ssize_t q2t_show_expl_conf_enabled(struct kobject *kobj, struct kobj_attr
|
||||
|
||||
vha = tgt->vha;
|
||||
|
||||
res = sysfs_emit(buffer, "%d\n%s",
|
||||
vha->hw->enable_explicit_conf,
|
||||
vha->hw->enable_explicit_conf ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
res = sysfs_emit(buffer, "%d\n", vha->hw->enable_explicit_conf);
|
||||
|
||||
if (vha->hw->enable_explicit_conf)
|
||||
res += sysfs_emit_at(buffer, res, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
out:
|
||||
return res;
|
||||
|
||||
@@ -562,12 +562,15 @@ out_complete:
|
||||
static ssize_t disk_sysfs_cluster_mode_show(struct kobject *kobj, struct kobj_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct scst_device *dev = container_of(kobj, struct scst_device,
|
||||
dev_kobj);
|
||||
struct scst_device *dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
ssize_t ret;
|
||||
|
||||
return sysfs_emit(buf, "%d\n%s",
|
||||
dev->cluster_mode,
|
||||
dev->cluster_mode ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", dev->cluster_mode);
|
||||
|
||||
if (dev->cluster_mode)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int disk_sysfs_process_cluster_mode_store(struct scst_sysfs_work_item *work)
|
||||
|
||||
@@ -7722,6 +7722,7 @@ static ssize_t vdev_size_show(struct kobject *kobj, struct kobj_attribute *attr,
|
||||
struct scst_vdisk_dev *virt_dev;
|
||||
unsigned long long size;
|
||||
bool key;
|
||||
ssize_t ret;
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
@@ -7734,8 +7735,12 @@ static ssize_t vdev_size_show(struct kobject *kobj, struct kobj_attribute *attr,
|
||||
*/
|
||||
key = !(virt_dev->nullio && size == VDISK_NULLIO_SIZE) && !size_shift;
|
||||
|
||||
return sysfs_emit(buf, "%llu\n%s",
|
||||
size >> size_shift, key ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%llu\n", size >> size_shift);
|
||||
|
||||
if (key)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t vdev_sysfs_size_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
|
||||
@@ -7764,9 +7769,10 @@ static ssize_t vdisk_sysfs_blocksize_show(struct kobject *kobj, struct kobj_attr
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
dev->block_size, dev->block_size == (1 << DEF_DISK_BLOCK_SHIFT) ? "" :
|
||||
SCST_SYSFS_KEY_MARK "\n");
|
||||
ret = sysfs_emit(buf, "%d\n", dev->block_size);
|
||||
|
||||
if (dev->block_size != (1 << DEF_DISK_BLOCK_SHIFT))
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
@@ -7803,13 +7809,16 @@ static ssize_t vdisk_opt_trans_len_store(struct kobject *kobj,
|
||||
static ssize_t vdisk_opt_trans_len_show(struct kobject *kobj,
|
||||
struct kobj_attribute *attr, char *buf)
|
||||
{
|
||||
struct scst_device *dev =
|
||||
container_of(kobj, struct scst_device, dev_kobj);
|
||||
struct scst_device *dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
struct scst_vdisk_dev *virt_dev = dev->dh_priv;
|
||||
ssize_t ret;
|
||||
|
||||
return sysfs_emit(buf, "%d\n%s",
|
||||
virt_dev->opt_trans_len,
|
||||
virt_dev->opt_trans_len_set ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", virt_dev->opt_trans_len);
|
||||
|
||||
if (virt_dev->opt_trans_len_set)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t vdisk_sysfs_rd_only_show(struct kobject *kobj, struct kobj_attribute *attr,
|
||||
@@ -7824,9 +7833,10 @@ static ssize_t vdisk_sysfs_rd_only_show(struct kobject *kobj, struct kobj_attrib
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
virt_dev->rd_only,
|
||||
virt_dev->rd_only == DEF_RD_ONLY ? "" : SCST_SYSFS_KEY_MARK "\n");
|
||||
ret = sysfs_emit(buf, "%d\n", virt_dev->rd_only);
|
||||
|
||||
if (virt_dev->rd_only != DEF_RD_ONLY)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
@@ -7843,9 +7853,10 @@ static ssize_t vdisk_sysfs_wt_show(struct kobject *kobj, struct kobj_attribute *
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
virt_dev->wt_flag,
|
||||
virt_dev->wt_flag == DEF_WRITE_THROUGH ? "" : SCST_SYSFS_KEY_MARK "\n");
|
||||
ret = sysfs_emit(buf, "%d\n", virt_dev->wt_flag);
|
||||
|
||||
if (virt_dev->wt_flag != DEF_WRITE_THROUGH)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
@@ -7862,9 +7873,10 @@ static ssize_t vdisk_sysfs_tp_show(struct kobject *kobj, struct kobj_attribute *
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
virt_dev->thin_provisioned,
|
||||
virt_dev->thin_provisioned_manually_set ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", virt_dev->thin_provisioned);
|
||||
|
||||
if (virt_dev->thin_provisioned_manually_set)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
@@ -7899,12 +7911,15 @@ static ssize_t vdisk_sysfs_expl_alua_show(struct kobject *kobj,
|
||||
struct kobj_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct scst_device *dev = container_of(kobj, struct scst_device,
|
||||
dev_kobj);
|
||||
struct scst_device *dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
ssize_t ret;
|
||||
|
||||
return sysfs_emit(buf, "%d\n%s",
|
||||
dev->expl_alua,
|
||||
dev->expl_alua != DEF_EXPL_ALUA ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", dev->expl_alua);
|
||||
|
||||
if (dev->expl_alua != DEF_EXPL_ALUA)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t vdisk_sysfs_expl_alua_store(struct kobject *kobj,
|
||||
@@ -7939,9 +7954,10 @@ static ssize_t vdisk_sysfs_nv_cache_show(struct kobject *kobj, struct kobj_attri
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
virt_dev->nv_cache,
|
||||
virt_dev->nv_cache == DEF_NV_CACHE ? "" : SCST_SYSFS_KEY_MARK "\n");
|
||||
ret = sysfs_emit(buf, "%d\n", virt_dev->nv_cache);
|
||||
|
||||
if (virt_dev->nv_cache != DEF_NV_CACHE)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
@@ -7959,9 +7975,10 @@ static ssize_t vdisk_sysfs_o_direct_show(struct kobject *kobj, struct kobj_attri
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
virt_dev->o_direct_flag,
|
||||
virt_dev->o_direct_flag == DEF_O_DIRECT ? "" : SCST_SYSFS_KEY_MARK "\n");
|
||||
ret = sysfs_emit(buf, "%d\n", virt_dev->o_direct_flag);
|
||||
|
||||
if (virt_dev->o_direct_flag != DEF_O_DIRECT)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
@@ -7970,26 +7987,32 @@ static ssize_t vdisk_sysfs_o_direct_show(struct kobject *kobj, struct kobj_attri
|
||||
static ssize_t vdev_sysfs_dummy_show(struct kobject *kobj,
|
||||
struct kobj_attribute *attr, char *buf)
|
||||
{
|
||||
struct scst_device *dev = container_of(kobj, struct scst_device,
|
||||
dev_kobj);
|
||||
struct scst_device *dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
struct scst_vdisk_dev *virt_dev = dev->dh_priv;
|
||||
ssize_t ret;
|
||||
|
||||
return sysfs_emit(buf, "%d\n%s",
|
||||
virt_dev->dummy,
|
||||
virt_dev->dummy != DEF_DUMMY ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", virt_dev->dummy);
|
||||
|
||||
if (virt_dev->dummy != DEF_DUMMY)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t vdev_sysfs_rz_show(struct kobject *kobj,
|
||||
struct kobj_attribute *attr, char *buf)
|
||||
{
|
||||
struct scst_device *dev = container_of(kobj, struct scst_device,
|
||||
dev_kobj);
|
||||
struct scst_device *dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
struct scst_vdisk_dev *virt_dev = dev->dh_priv;
|
||||
bool read_zero = virt_dev->read_zero;
|
||||
ssize_t ret;
|
||||
|
||||
return sysfs_emit(buf, "%d\n%s",
|
||||
read_zero,
|
||||
read_zero != DEF_READ_ZERO ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", read_zero);
|
||||
|
||||
if (read_zero != DEF_READ_ZERO)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t vdev_sysfs_rz_store(struct kobject *kobj,
|
||||
@@ -8287,10 +8310,14 @@ static ssize_t vdev_sysfs_cluster_mode_show(struct kobject *kobj, struct kobj_at
|
||||
char *buf)
|
||||
{
|
||||
struct scst_device *dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
ssize_t ret;
|
||||
|
||||
return sysfs_emit(buf, "%d\n%s",
|
||||
dev->cluster_mode,
|
||||
dev->cluster_mode ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", dev->cluster_mode);
|
||||
|
||||
if (dev->cluster_mode)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int vdev_sysfs_process_cluster_mode_store(struct scst_sysfs_work_item *work)
|
||||
@@ -8474,9 +8501,12 @@ static ssize_t vdev_sysfs_t10_vend_id_show(struct kobject *kobj,
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
read_lock(&vdisk_serial_rwlock);
|
||||
ret = sysfs_emit(buf, "%s\n%s",
|
||||
virt_dev->t10_vend_id,
|
||||
virt_dev->t10_vend_id_set ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
|
||||
ret = sysfs_emit(buf, "%s\n", virt_dev->t10_vend_id);
|
||||
|
||||
if (virt_dev->t10_vend_id_set)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
read_unlock(&vdisk_serial_rwlock);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
@@ -8534,9 +8564,12 @@ static ssize_t vdev_sysfs_vend_specific_id_show(struct kobject *kobj,
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
read_lock(&vdisk_serial_rwlock);
|
||||
ret = sysfs_emit(buf, "%s\n%s",
|
||||
virt_dev->vend_specific_id,
|
||||
virt_dev->vend_specific_id_set ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
|
||||
ret = sysfs_emit(buf, "%s\n", virt_dev->vend_specific_id);
|
||||
|
||||
if (virt_dev->vend_specific_id_set)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
read_unlock(&vdisk_serial_rwlock);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
@@ -8594,9 +8627,12 @@ static ssize_t vdev_sysfs_prod_id_show(struct kobject *kobj,
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
read_lock(&vdisk_serial_rwlock);
|
||||
ret = sysfs_emit(buf, "%s\n%s",
|
||||
virt_dev->prod_id,
|
||||
virt_dev->prod_id_set ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
|
||||
ret = sysfs_emit(buf, "%s\n", virt_dev->prod_id);
|
||||
|
||||
if (virt_dev->prod_id_set)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
read_unlock(&vdisk_serial_rwlock);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
@@ -8654,9 +8690,12 @@ static ssize_t vdev_sysfs_prod_rev_lvl_show(struct kobject *kobj,
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
read_lock(&vdisk_serial_rwlock);
|
||||
ret = sysfs_emit(buf, "%s\n%s",
|
||||
virt_dev->prod_rev_lvl,
|
||||
virt_dev->prod_rev_lvl_set ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
|
||||
ret = sysfs_emit(buf, "%s\n", virt_dev->prod_rev_lvl);
|
||||
|
||||
if (virt_dev->prod_rev_lvl_set)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
read_unlock(&vdisk_serial_rwlock);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
@@ -8715,9 +8754,12 @@ static ssize_t vdev_sysfs_scsi_device_name_show(struct kobject *kobj, struct kob
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
read_lock(&vdisk_serial_rwlock);
|
||||
ret = sysfs_emit(buf, "%s\n%s",
|
||||
virt_dev->scsi_device_name,
|
||||
virt_dev->scsi_device_name_set ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
|
||||
ret = sysfs_emit(buf, "%s\n", virt_dev->scsi_device_name);
|
||||
|
||||
if (virt_dev->scsi_device_name_set)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
read_unlock(&vdisk_serial_rwlock);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
@@ -8774,9 +8816,12 @@ static ssize_t vdev_sysfs_t10_dev_id_show(struct kobject *kobj, struct kobj_attr
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
read_lock(&vdisk_serial_rwlock);
|
||||
ret = sysfs_emit(buf, "%s\n%s",
|
||||
virt_dev->t10_dev_id,
|
||||
virt_dev->t10_dev_id_set ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
|
||||
ret = sysfs_emit(buf, "%s\n", virt_dev->t10_dev_id);
|
||||
|
||||
if (virt_dev->t10_dev_id_set)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
read_unlock(&vdisk_serial_rwlock);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
@@ -8848,8 +8893,11 @@ static ssize_t vdev_sysfs_eui64_id_show(struct kobject *kobj,
|
||||
for (i = 0; i < virt_dev->eui64_id_len; i++)
|
||||
ret += sysfs_emit_at(buf, ret, "%02x", virt_dev->eui64_id[i]);
|
||||
|
||||
ret += sysfs_emit_at(buf, ret, "\n%s",
|
||||
virt_dev->eui64_id_len ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret += sysfs_emit_at(buf, ret, "\n");
|
||||
|
||||
if (virt_dev->eui64_id_len)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
read_unlock(&vdisk_serial_rwlock);
|
||||
|
||||
return ret;
|
||||
@@ -8926,8 +8974,11 @@ static ssize_t vdev_sysfs_naa_id_show(struct kobject *kobj, struct kobj_attribut
|
||||
for (i = 0; i < virt_dev->naa_id_len; i++)
|
||||
ret += sysfs_emit_at(buf, ret, "%02x", virt_dev->naa_id[i]);
|
||||
|
||||
ret += sysfs_emit_at(buf, ret, "\n%s",
|
||||
virt_dev->naa_id_len ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret += sysfs_emit_at(buf, ret, "\n");
|
||||
|
||||
if (virt_dev->naa_id_len)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
read_unlock(&vdisk_serial_rwlock);
|
||||
|
||||
return ret;
|
||||
@@ -8995,9 +9046,12 @@ static ssize_t vdev_sysfs_usn_show(struct kobject *kobj, struct kobj_attribute *
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
read_lock(&vdisk_serial_rwlock);
|
||||
ret = sysfs_emit(buf, "%s\n%s",
|
||||
virt_dev->usn,
|
||||
virt_dev->usn_set ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
|
||||
ret = sysfs_emit(buf, "%s\n", virt_dev->usn);
|
||||
|
||||
if (virt_dev->usn_set)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
read_unlock(&vdisk_serial_rwlock);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
@@ -9045,10 +9099,12 @@ static ssize_t vdev_sysfs_inq_vend_specific_show(struct kobject *kobj,
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
read_lock(&vdisk_serial_rwlock);
|
||||
ret = sysfs_emit(buf, "%.*s\n%s",
|
||||
virt_dev->inq_vend_specific_len,
|
||||
virt_dev->inq_vend_specific,
|
||||
virt_dev->inq_vend_specific_len ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%.*s\n",
|
||||
virt_dev->inq_vend_specific_len, virt_dev->inq_vend_specific);
|
||||
|
||||
if (virt_dev->inq_vend_specific_len)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
read_unlock(&vdisk_serial_rwlock);
|
||||
|
||||
return ret;
|
||||
@@ -9060,13 +9116,17 @@ static ssize_t vdev_sysfs_active_show(struct kobject *kobj,
|
||||
{
|
||||
struct scst_device *dev;
|
||||
struct scst_vdisk_dev *virt_dev;
|
||||
ssize_t ret;
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
return sysfs_emit(buf, "%d\n%s",
|
||||
virt_dev->dev_active,
|
||||
virt_dev->dev_active != DEF_DEV_ACTIVE ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", virt_dev->dev_active);
|
||||
|
||||
if (virt_dev->dev_active != DEF_DEV_ACTIVE)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int vdev_sysfs_process_active_store(struct scst_sysfs_work_item *work)
|
||||
@@ -9183,9 +9243,10 @@ static ssize_t vdev_sysfs_bind_alua_state_show(struct kobject *kobj,
|
||||
bind_alua_state = virt_dev->bind_alua_state;
|
||||
spin_unlock(&virt_dev->flags_lock);
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
bind_alua_state,
|
||||
bind_alua_state != DEF_BIND_ALUA_STATE ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", bind_alua_state);
|
||||
|
||||
if (bind_alua_state != DEF_BIND_ALUA_STATE)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
@@ -9246,13 +9307,16 @@ static ssize_t vdev_async_store(struct kobject *kobj, struct kobj_attribute *att
|
||||
static ssize_t vdev_async_show(struct kobject *kobj,
|
||||
struct kobj_attribute *attr, char *buf)
|
||||
{
|
||||
struct scst_device *dev =
|
||||
container_of(kobj, struct scst_device, dev_kobj);
|
||||
struct scst_device *dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
struct scst_vdisk_dev *virt_dev = dev->dh_priv;
|
||||
ssize_t ret;
|
||||
|
||||
return sysfs_emit(buf, "%d\n%s",
|
||||
virt_dev->async,
|
||||
virt_dev->async ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", virt_dev->async);
|
||||
|
||||
if (virt_dev->async)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t vdev_dif_filename_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf)
|
||||
@@ -9266,9 +9330,10 @@ static ssize_t vdev_dif_filename_show(struct kobject *kobj, struct kobj_attribut
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
ret = sysfs_emit(buf, "%s\n%s",
|
||||
virt_dev->dif_filename,
|
||||
virt_dev->dif_filename ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%s\n", virt_dev->dif_filename);
|
||||
|
||||
if (virt_dev->dif_filename)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
@@ -9299,14 +9364,16 @@ static ssize_t vdev_lb_per_pb_exp_store(struct kobject *kobj, struct kobj_attrib
|
||||
static ssize_t vdev_lb_per_pb_exp_show(struct kobject *kobj, struct kobj_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct scst_device *dev =
|
||||
container_of(kobj, struct scst_device, dev_kobj);
|
||||
struct scst_device *dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
struct scst_vdisk_dev *virt_dev = dev->dh_priv;
|
||||
ssize_t ret;
|
||||
|
||||
return sysfs_emit(buf, "%d\n%s",
|
||||
virt_dev->lb_per_pb_exp,
|
||||
virt_dev->lb_per_pb_exp == DEF_LB_PER_PB_EXP ? "" :
|
||||
SCST_SYSFS_KEY_MARK "\n");
|
||||
ret = sysfs_emit(buf, "%d\n", virt_dev->lb_per_pb_exp);
|
||||
|
||||
if (virt_dev->lb_per_pb_exp != DEF_LB_PER_PB_EXP)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static struct kobj_attribute vdev_active_attr =
|
||||
|
||||
@@ -3715,10 +3715,10 @@ static ssize_t scst_cm_allow_not_conn_copy_show(struct kobject *kobj, struct kob
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
scst_cm_allow_not_connected_copy,
|
||||
scst_cm_allow_not_connected_copy == SCST_ALLOW_NOT_CONN_COPY_DEF ?
|
||||
"" : SCST_SYSFS_KEY_MARK "\n");
|
||||
ret = sysfs_emit(buf, "%d\n", scst_cm_allow_not_connected_copy);
|
||||
|
||||
if (scst_cm_allow_not_connected_copy != SCST_ALLOW_NOT_CONN_COPY_DEF)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
|
||||
+86
-63
@@ -2303,9 +2303,10 @@ static ssize_t scst_rel_tgt_id_show(struct kobject *kobj, struct kobj_attribute
|
||||
|
||||
tgt = container_of(kobj, struct scst_tgt, tgt_kobj);
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
tgt->rel_tgt_id,
|
||||
tgt->rel_tgt_id != 0 ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", tgt->rel_tgt_id);
|
||||
|
||||
if (tgt->rel_tgt_id)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
@@ -2407,10 +2408,14 @@ static ssize_t scst_tgt_forward_src_show(struct kobject *kobj, struct kobj_attri
|
||||
char *buf)
|
||||
{
|
||||
struct scst_tgt *tgt = container_of(kobj, struct scst_tgt, tgt_kobj);
|
||||
ssize_t ret;
|
||||
|
||||
return sysfs_emit(buf, "%d\n%s",
|
||||
tgt->tgt_forward_src,
|
||||
tgt->tgt_forward_src ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", tgt->tgt_forward_src);
|
||||
|
||||
if (tgt->tgt_forward_src)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t scst_tgt_forward_src_store(struct kobject *kobj, struct kobj_attribute *attr,
|
||||
@@ -2451,9 +2456,10 @@ static ssize_t scst_tgt_forward_dst_show(struct kobject *kobj, struct kobj_attri
|
||||
|
||||
tgt = container_of(kobj, struct scst_tgt, tgt_kobj);
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
tgt->tgt_forward_dst,
|
||||
tgt->tgt_forward_dst ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", tgt->tgt_forward_dst);
|
||||
|
||||
if (tgt->tgt_forward_dst)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
@@ -2552,9 +2558,10 @@ static ssize_t scst_tgt_aen_disabled_show(struct kobject *kobj, struct kobj_attr
|
||||
|
||||
tgt = container_of(kobj, struct scst_tgt, tgt_kobj);
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
tgt->tgt_aen_disabled,
|
||||
tgt->tgt_aen_disabled ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", tgt->tgt_aen_disabled);
|
||||
|
||||
if (tgt->tgt_aen_disabled)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
@@ -3101,9 +3108,12 @@ static ssize_t scst_dev_sysfs_pr_file_name_show(struct kobject *kobj,
|
||||
res = mutex_lock_interruptible(&dev->dev_pr_mutex);
|
||||
if (res != 0)
|
||||
goto out;
|
||||
res = sysfs_emit(buf, "%s\n%s",
|
||||
dev->pr_file_name ? : "",
|
||||
dev->pr_file_name_is_set ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
|
||||
res = sysfs_emit(buf, "%s\n", dev->pr_file_name ? : "");
|
||||
|
||||
if (dev->pr_file_name_is_set)
|
||||
res += sysfs_emit_at(buf, res, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
mutex_unlock(&dev->dev_pr_mutex);
|
||||
|
||||
out:
|
||||
@@ -3342,10 +3352,10 @@ static ssize_t scst_dev_sysfs_threads_num_show(struct kobject *kobj, struct kobj
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
dev->threads_num,
|
||||
dev->threads_num != dev->handler->threads_num ?
|
||||
SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", dev->threads_num);
|
||||
|
||||
if (dev->threads_num != dev->handler->threads_num)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
@@ -3421,16 +3431,16 @@ static ssize_t scst_dev_sysfs_threads_pool_type_show(struct kobject *kobj,
|
||||
|
||||
switch (dev->threads_pool_type) {
|
||||
case SCST_THREADS_POOL_PER_INITIATOR:
|
||||
ret = sysfs_emit(buf, "%s\n%s",
|
||||
SCST_THREADS_POOL_PER_INITIATOR_STR,
|
||||
dev->threads_pool_type != dev->handler->threads_pool_type ?
|
||||
SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%s\n", SCST_THREADS_POOL_PER_INITIATOR_STR);
|
||||
|
||||
if (dev->threads_pool_type != dev->handler->threads_pool_type)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
break;
|
||||
case SCST_THREADS_POOL_SHARED:
|
||||
ret = sysfs_emit(buf, "%s\n%s",
|
||||
SCST_THREADS_POOL_SHARED_STR,
|
||||
dev->threads_pool_type != dev->handler->threads_pool_type ?
|
||||
SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%s\n", SCST_THREADS_POOL_SHARED_STR);
|
||||
|
||||
if (dev->threads_pool_type != dev->handler->threads_pool_type)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
break;
|
||||
default:
|
||||
ret = sysfs_emit(buf, "Unknown\n");
|
||||
@@ -3501,10 +3511,10 @@ static ssize_t scst_dev_sysfs_max_tgt_dev_commands_show(struct kobject *kobj,
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
dev->max_tgt_dev_commands,
|
||||
dev->max_tgt_dev_commands != dev->handler->max_tgt_dev_commands ?
|
||||
SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", dev->max_tgt_dev_commands);
|
||||
|
||||
if (dev->max_tgt_dev_commands != dev->handler->max_tgt_dev_commands)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
@@ -3561,9 +3571,10 @@ static ssize_t scst_dev_numa_node_id_show(struct kobject *kobj, struct kobj_attr
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
dev->dev_numa_node_id,
|
||||
dev->dev_numa_node_id != NUMA_NO_NODE ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", dev->dev_numa_node_id);
|
||||
|
||||
if (dev->dev_numa_node_id != NUMA_NO_NODE)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
@@ -4004,9 +4015,10 @@ static ssize_t scst_dev_dif_type_show(struct kobject *kobj, struct kobj_attribut
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
dev->dev_dif_type,
|
||||
dev->dev_dif_type != 0 ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", dev->dev_dif_type);
|
||||
|
||||
if (dev->dev_dif_type)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
@@ -4060,9 +4072,10 @@ static ssize_t scst_dev_sysfs_dif_static_app_tag_show(struct kobject *kobj,
|
||||
|
||||
a = scst_dev_get_dif_static_app_tag_combined(dev);
|
||||
|
||||
ret = sysfs_emit(buf, "0x%llx\n%s",
|
||||
(unsigned long long)be64_to_cpu(a),
|
||||
a != SCST_DIF_NO_CHECK_APP_TAG ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "0x%llx\n", (unsigned long long)be64_to_cpu(a));
|
||||
|
||||
if (a != SCST_DIF_NO_CHECK_APP_TAG)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(ret);
|
||||
return ret;
|
||||
@@ -6390,12 +6403,15 @@ static ssize_t scst_tg_preferred_show(struct kobject *kobj,
|
||||
struct kobj_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct scst_target_group *tg;
|
||||
struct scst_target_group *tg = container_of(kobj, struct scst_target_group, kobj);
|
||||
ssize_t ret;
|
||||
|
||||
tg = container_of(kobj, struct scst_target_group, kobj);
|
||||
ret = sysfs_emit(buf, "%u\n", tg->preferred);
|
||||
|
||||
return sysfs_emit(buf, "%u\n%s", tg->preferred,
|
||||
tg->preferred ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
if (tg->preferred)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int scst_tg_preferred_store_work_fn(struct scst_sysfs_work_item *w)
|
||||
@@ -6965,10 +6981,10 @@ static ssize_t scst_threads_show(struct kobject *kobj, struct kobj_attribute *at
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
scst_main_cmd_threads.nr_threads,
|
||||
(scst_main_cmd_threads.nr_threads != scst_threads) ?
|
||||
SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ret = sysfs_emit(buf, "%d\n", scst_main_cmd_threads.nr_threads);
|
||||
|
||||
if (scst_main_cmd_threads.nr_threads != scst_threads)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT();
|
||||
|
||||
@@ -7072,9 +7088,10 @@ static ssize_t scst_setup_id_show(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
ret = sysfs_emit(buf, "0x%x\n%s",
|
||||
scst_setup_id,
|
||||
scst_setup_id == 0 ? "" : SCST_SYSFS_KEY_MARK "\n");
|
||||
ret = sysfs_emit(buf, "0x%x\n", scst_setup_id);
|
||||
|
||||
if (scst_setup_id)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT();
|
||||
|
||||
@@ -7115,10 +7132,10 @@ static ssize_t scst_max_tasklet_cmd_show(struct kobject *kobj, struct kobj_attri
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n%s",
|
||||
scst_max_tasklet_cmd,
|
||||
scst_max_tasklet_cmd == SCST_DEF_MAX_TASKLET_CMD ?
|
||||
"" : SCST_SYSFS_KEY_MARK "\n");
|
||||
ret = sysfs_emit(buf, "%d\n", scst_max_tasklet_cmd);
|
||||
|
||||
if (scst_max_tasklet_cmd != SCST_DEF_MAX_TASKLET_CMD)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT();
|
||||
|
||||
@@ -7160,9 +7177,11 @@ static ssize_t scst_poll_us_show(struct kobject *kobj, struct kobj_attribute *at
|
||||
TRACE_ENTRY();
|
||||
|
||||
do_div(t, 1000);
|
||||
ret = sysfs_emit(buf, "%lld\n%s",
|
||||
t,
|
||||
scst_poll_ns == SCST_DEF_POLL_NS ? "" : SCST_SYSFS_KEY_MARK "\n");
|
||||
|
||||
ret = sysfs_emit(buf, "%lld\n", t);
|
||||
|
||||
if (scst_poll_ns != SCST_DEF_POLL_NS)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT();
|
||||
|
||||
@@ -7284,9 +7303,14 @@ static struct kobj_attribute scst_main_trace_level_attr =
|
||||
static ssize_t scst_force_global_sgv_pool_show(struct kobject *kobj, struct kobj_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
return sysfs_emit(buf, "%d\n%s",
|
||||
scst_force_global_sgv_pool,
|
||||
scst_force_global_sgv_pool ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
ssize_t ret;
|
||||
|
||||
ret = sysfs_emit(buf, "%d\n", scst_force_global_sgv_pool);
|
||||
|
||||
if (scst_force_global_sgv_pool)
|
||||
ret += sysfs_emit_at(buf, ret, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static ssize_t scst_force_global_sgv_pool_store(struct kobject *kobj, struct kobj_attribute *attr,
|
||||
@@ -7470,8 +7494,7 @@ static ssize_t scst_cluster_name_show(struct kobject *kobj, struct kobj_attribut
|
||||
TRACE_ENTRY();
|
||||
|
||||
if (scst_cluster_name)
|
||||
res = sysfs_emit(buf, "%s\n%s",
|
||||
scst_cluster_name, SCST_SYSFS_KEY_MARK "\n");
|
||||
res = sysfs_emit(buf, "%s\n%s\n", scst_cluster_name, SCST_SYSFS_KEY_MARK);
|
||||
|
||||
TRACE_EXIT_RES(res);
|
||||
return res;
|
||||
|
||||
@@ -376,9 +376,10 @@ static ssize_t scst_local_phys_transport_version_show(struct kobject *kobj,
|
||||
if (!tgt)
|
||||
goto out_up;
|
||||
|
||||
res = sysfs_emit(buf, "0x%x\n%s",
|
||||
tgt->phys_transport_version,
|
||||
tgt->phys_transport_version != 0 ? SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
res = sysfs_emit(buf, "0x%x\n", tgt->phys_transport_version);
|
||||
|
||||
if (tgt->phys_transport_version != 0)
|
||||
res += sysfs_emit_at(buf, res, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
out_up:
|
||||
up_read(&scst_local_exit_rwsem);
|
||||
|
||||
+6
-4
@@ -4073,10 +4073,12 @@ static ssize_t show_port_id(struct kobject *kobj, struct kobj_attribute *attr, c
|
||||
goto out;
|
||||
|
||||
mutex_lock(&sport->mutex);
|
||||
res = sysfs_emit(buf, "%s\n%s",
|
||||
sport->port_id,
|
||||
strcmp(sport->port_id, DEFAULT_SRPT_ID_STRING) ?
|
||||
SCST_SYSFS_KEY_MARK "\n" : "");
|
||||
|
||||
res = sysfs_emit(buf, "%s\n", sport->port_id);
|
||||
|
||||
if (strcmp(sport->port_id, DEFAULT_SRPT_ID_STRING))
|
||||
res += sysfs_emit_at(buf, res, "%s\n", SCST_SYSFS_KEY_MARK);
|
||||
|
||||
mutex_unlock(&sport->mutex);
|
||||
|
||||
out:
|
||||
|
||||
Reference in New Issue
Block a user