mirror of
https://github.com/SCST-project/scst.git
synced 2026-07-20 06:52:18 +00:00
sysfs: Add debug logs for sysfs attribute calls
This commit is contained in:
committed by
Gleb Chesnokov
parent
3961019e74
commit
092e8e34c0
@@ -177,6 +177,14 @@ do { \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define PRINT_SYSFS_BUFFER(kobj, kattr, buf) \
|
||||
do { \
|
||||
const char *sysfs_path = kobject_get_path((kobj), GFP_KERNEL); \
|
||||
PRINT_INFO("SYSFS: %s/%s: %s", \
|
||||
sysfs_path, (kattr)->attr.name, (buf)); \
|
||||
kfree_const(sysfs_path); \
|
||||
} while (0)
|
||||
|
||||
#define PRINT_LOG_FLAG(log_flag, format, args...) \
|
||||
debug_print_with_prefix(trace_flag, KERN_INFO, __LOG_PREFIX, \
|
||||
__func__, __LINE__, format, ## args)
|
||||
|
||||
@@ -7645,6 +7645,8 @@ static ssize_t vdisk_sysfs_sync_store(struct kobject *kobj,
|
||||
struct scst_vdisk_dev *virt_dev = dev->dh_priv;
|
||||
int res;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
if (virt_dev->nullio)
|
||||
res = 0;
|
||||
else if (virt_dev->blockio)
|
||||
@@ -7686,6 +7688,8 @@ static ssize_t vcdrom_sysfs_filename_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
|
||||
i_buf = kasprintf(GFP_KERNEL, "%.*s", (int)count, buf);
|
||||
@@ -7808,6 +7812,8 @@ out_free:
|
||||
static ssize_t vdev_sysfs_size_store(struct kobject *kobj,
|
||||
struct kobj_attribute *attr, const char *buf, size_t count)
|
||||
{
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
return vdev_size_store(kobj, attr, buf, count, 0);
|
||||
}
|
||||
|
||||
@@ -7843,6 +7849,8 @@ static ssize_t vdev_sysfs_size_show(struct kobject *kobj,
|
||||
static ssize_t vdev_sysfs_size_mb_store(struct kobject *kobj,
|
||||
struct kobj_attribute *attr, const char *buf, size_t count)
|
||||
{
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
return vdev_size_store(kobj, attr, buf, count, 20);
|
||||
}
|
||||
|
||||
@@ -7880,6 +7888,8 @@ static ssize_t vdisk_opt_trans_len_store(struct kobject *kobj,
|
||||
unsigned long val;
|
||||
int res;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = kstrtoul(buf, 0, &val);
|
||||
if (res)
|
||||
return res;
|
||||
@@ -8018,6 +8028,8 @@ static ssize_t vdisk_sysfs_expl_alua_store(struct kobject *kobj,
|
||||
unsigned long expl_alua;
|
||||
int res;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = kstrtoul(buf, 0, &expl_alua);
|
||||
if (res < 0)
|
||||
return res;
|
||||
@@ -8103,6 +8115,8 @@ static ssize_t vdev_sysfs_rz_store(struct kobject *kobj,
|
||||
int res;
|
||||
char ch[16];
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
sprintf(ch, "%.*s", min_t(int, sizeof(ch) - 1, count), buf);
|
||||
res = kstrtol(ch, 0, &read_zero);
|
||||
if (res)
|
||||
@@ -8364,6 +8378,8 @@ static ssize_t vdev_sysfs_filename_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = -ENOMEM;
|
||||
arg = kasprintf(GFP_KERNEL, "%.*s", (int)count, buf);
|
||||
if (!arg)
|
||||
@@ -8458,6 +8474,8 @@ static ssize_t vdev_sysfs_cluster_mode_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = -ENOMEM;
|
||||
arg = kasprintf(GFP_KERNEL, "%.*s", (int)count, buf);
|
||||
if (!arg)
|
||||
@@ -8542,6 +8560,8 @@ static ssize_t vdev_sysfs_t10_vend_id_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
p = memchr(buf, '\n', count);
|
||||
@@ -8602,6 +8622,8 @@ static ssize_t vdev_sysfs_vend_specific_id_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
p = memchr(buf, '\n', count);
|
||||
@@ -8663,6 +8685,8 @@ static ssize_t vdev_sysfs_prod_id_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
p = memchr(buf, '\n', count);
|
||||
@@ -8722,6 +8746,8 @@ static ssize_t vdev_sysfs_prod_rev_lvl_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
p = memchr(buf, '\n', count);
|
||||
@@ -8783,6 +8809,8 @@ static ssize_t vdev_sysfs_scsi_device_name_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
p = memchr(buf, '\n', count);
|
||||
@@ -8843,6 +8871,8 @@ static ssize_t vdev_sysfs_t10_dev_id_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
@@ -8919,6 +8949,8 @@ static ssize_t vdev_sysfs_eui64_id_store(struct kobject *kobj,
|
||||
struct scst_device *dev;
|
||||
struct scst_vdisk_dev *virt_dev;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
@@ -8988,6 +9020,8 @@ static ssize_t vdev_sysfs_naa_id_store(struct kobject *kobj,
|
||||
struct scst_device *dev;
|
||||
struct scst_vdisk_dev *virt_dev;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
@@ -9065,6 +9099,8 @@ static ssize_t vdev_sysfs_usn_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
|
||||
@@ -9137,6 +9173,8 @@ static ssize_t vdev_sysfs_inq_vend_specific_store(struct kobject *kobj,
|
||||
char *p;
|
||||
int res = -EINVAL, len;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
p = memchr(buf, '\n', count);
|
||||
@@ -9272,6 +9310,8 @@ static ssize_t vdev_sysfs_active_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = -ENOMEM;
|
||||
arg = kasprintf(GFP_KERNEL, "%.*s", (int)count, buf);
|
||||
if (!arg)
|
||||
@@ -9331,6 +9371,8 @@ static ssize_t vdev_sysfs_bind_alua_state_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
virt_dev = dev->dh_priv;
|
||||
strlcpy(ch, buf, 16);
|
||||
@@ -9358,6 +9400,8 @@ static ssize_t vdev_async_store(struct kobject *kobj,
|
||||
long val;
|
||||
int res;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = kstrtol(buf, 0, &val);
|
||||
if (res)
|
||||
return res;
|
||||
|
||||
@@ -825,6 +825,8 @@ static ssize_t scst_tgtt_trace_level_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
tgtt = container_of(kobj, struct scst_tgt_template, tgtt_kobj);
|
||||
|
||||
res = mutex_lock_interruptible(&scst_log_mutex);
|
||||
@@ -964,6 +966,8 @@ static ssize_t scst_tgtt_mgmt_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
tgtt = container_of(kobj, struct scst_tgt_template, tgtt_kobj);
|
||||
|
||||
buffer = kasprintf(GFP_KERNEL, "%.*s", (int)count, buf);
|
||||
@@ -1535,6 +1539,8 @@ static ssize_t scst_luns_mgmt_store(struct kobject *kobj,
|
||||
struct scst_acg *acg;
|
||||
struct scst_tgt *tgt;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
tgt = container_of(kobj->parent, struct scst_tgt, tgt_kobj);
|
||||
acg = tgt->default_acg;
|
||||
|
||||
@@ -1613,6 +1619,8 @@ static ssize_t scst_tgt_addr_method_store(struct kobject *kobj,
|
||||
struct scst_acg *acg;
|
||||
struct scst_tgt *tgt;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
tgt = container_of(kobj, struct scst_tgt, tgt_kobj);
|
||||
acg = tgt->default_acg;
|
||||
|
||||
@@ -1765,6 +1773,8 @@ static ssize_t scst_tgt_io_grouping_type_store(struct kobject *kobj,
|
||||
struct scst_acg *acg;
|
||||
struct scst_tgt *tgt;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
tgt = container_of(kobj, struct scst_tgt, tgt_kobj);
|
||||
acg = tgt->default_acg;
|
||||
|
||||
@@ -1889,6 +1899,8 @@ static ssize_t scst_tgt_black_hole_store(struct kobject *kobj,
|
||||
struct scst_acg *acg;
|
||||
struct scst_tgt *tgt;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
tgt = container_of(kobj, struct scst_tgt, tgt_kobj);
|
||||
acg = tgt->default_acg;
|
||||
|
||||
@@ -2062,6 +2074,8 @@ static ssize_t scst_tgt_cpu_mask_store(struct kobject *kobj,
|
||||
struct scst_acg *acg;
|
||||
struct scst_tgt *tgt;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
tgt = container_of(kobj, struct scst_tgt, tgt_kobj);
|
||||
acg = tgt->default_acg;
|
||||
|
||||
@@ -2199,6 +2213,8 @@ static ssize_t scst_ini_group_mgmt_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
tgt = container_of(kobj->parent, struct scst_tgt, tgt_kobj);
|
||||
|
||||
buffer = kasprintf(GFP_KERNEL, "%.*s", (int)count, buf);
|
||||
@@ -2303,6 +2319,8 @@ static ssize_t scst_tgt_enable_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
if (buf == NULL) {
|
||||
PRINT_ERROR("%s: NULL buffer?", __func__);
|
||||
res = -EINVAL;
|
||||
@@ -2425,6 +2443,8 @@ static ssize_t scst_rel_tgt_id_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
if (buf == NULL)
|
||||
goto out;
|
||||
|
||||
@@ -2476,6 +2496,8 @@ static ssize_t scst_tgt_forward_src_store(struct kobject *kobj,
|
||||
struct scst_tgt *tgt = container_of(kobj, struct scst_tgt, tgt_kobj);
|
||||
int res, old, new;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = kstrtoint(buf, 0, &new);
|
||||
if (res < 0)
|
||||
return res;
|
||||
@@ -2526,6 +2548,8 @@ static ssize_t scst_tgt_forward_dst_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
if ((buf == NULL) || (count == 0)) {
|
||||
res = 0;
|
||||
goto out;
|
||||
@@ -2629,6 +2653,8 @@ static ssize_t scst_tgt_comment_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
if ((buf == NULL) || (count == 0)) {
|
||||
res = 0;
|
||||
goto out;
|
||||
@@ -2778,6 +2804,8 @@ static ssize_t scst_tgt_dif_checks_failed_store(struct kobject *kobj,
|
||||
{
|
||||
struct scst_tgt *tgt;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
tgt = container_of(kobj, struct scst_tgt, tgt_kobj);
|
||||
|
||||
PRINT_INFO("Zeroing DIF failures statistics for target %s",
|
||||
@@ -3156,6 +3184,8 @@ static ssize_t scst_dev_sysfs_pr_file_name_store(struct kobject *kobj,
|
||||
int res = -EPERM;
|
||||
bool def = false;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
|
||||
if (dev->cluster_mode)
|
||||
@@ -3348,6 +3378,8 @@ static ssize_t scst_dev_sysfs_threads_num_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
|
||||
res = kstrtol(buf, 0, &newtn);
|
||||
@@ -3440,6 +3472,8 @@ static ssize_t scst_dev_sysfs_threads_pool_type_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
|
||||
newtpt = scst_parse_threads_pool_type(buf, count);
|
||||
@@ -3507,6 +3541,8 @@ static ssize_t scst_dev_sysfs_max_tgt_dev_commands_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
|
||||
res = kstrtol(buf, 0, &newtn);
|
||||
@@ -3566,6 +3602,8 @@ static ssize_t scst_dev_numa_node_id_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
|
||||
res = kstrtol(buf, 0, &newtn);
|
||||
@@ -3631,6 +3669,8 @@ static ssize_t scst_dev_block_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
|
||||
switch (*p) {
|
||||
@@ -4032,6 +4072,8 @@ static ssize_t scst_dev_sysfs_dif_static_app_tag_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
dev = container_of(kobj, struct scst_device, dev_kobj);
|
||||
|
||||
res = kstrtoull(buf, 0, &val);
|
||||
@@ -4202,6 +4244,8 @@ static ssize_t scst_tgt_dev_dif_checks_failed_store(struct kobject *kobj,
|
||||
{
|
||||
struct scst_tgt_dev *tgt_dev;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
tgt_dev = container_of(kobj, struct scst_tgt_dev, tgt_dev_kobj);
|
||||
|
||||
PRINT_INFO("Zeroing DIF failures statistics for initiator "
|
||||
@@ -4470,6 +4514,8 @@ static ssize_t scst_sess_latency_store(struct kobject *kobj,
|
||||
struct scst_session *sess =
|
||||
container_of(kobj->parent, struct scst_session, sess_kobj);
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
spin_lock_irq(&sess->lat_stats_lock);
|
||||
BUILD_BUG_ON(sizeof(*sess->lat_stats) != sizeof(struct scst_lat_stats));
|
||||
memset(sess->lat_stats, 0, sizeof(*sess->lat_stats));
|
||||
@@ -4677,6 +4723,8 @@ static ssize_t scst_sess_sysfs_dif_checks_failed_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
sess = container_of(kobj, struct scst_session, sess_kobj);
|
||||
|
||||
res = scst_alloc_sysfs_work(scst_sess_zero_dif_checks_failed, false, &work);
|
||||
@@ -4780,6 +4828,8 @@ static ssize_t scst_sess_force_close_store(struct kobject *kobj,
|
||||
sess_kobj);
|
||||
int res;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = sess->tgt->tgtt->close_session(sess);
|
||||
if (res < 0)
|
||||
goto out;
|
||||
@@ -5351,6 +5401,8 @@ static ssize_t scst_acg_ini_mgmt_store(struct kobject *kobj,
|
||||
{
|
||||
struct scst_acg *acg;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
acg = container_of(kobj->parent, struct scst_acg, acg_kobj);
|
||||
|
||||
return __scst_acg_mgmt_store(acg, buf, count, false,
|
||||
@@ -5368,6 +5420,8 @@ static ssize_t scst_acg_luns_mgmt_store(struct kobject *kobj,
|
||||
int res;
|
||||
struct scst_acg *acg;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
acg = container_of(kobj->parent, struct scst_acg, acg_kobj);
|
||||
res = __scst_luns_mgmt_store(acg, false, buf, count);
|
||||
|
||||
@@ -5395,6 +5449,8 @@ static ssize_t scst_acg_addr_method_store(struct kobject *kobj,
|
||||
int res;
|
||||
struct scst_acg *acg;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
acg = container_of(kobj, struct scst_acg, acg_kobj);
|
||||
|
||||
res = __scst_acg_addr_method_store(acg, buf, count);
|
||||
@@ -5423,6 +5479,8 @@ static ssize_t scst_acg_io_grouping_type_store(struct kobject *kobj,
|
||||
int res;
|
||||
struct scst_acg *acg;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
acg = container_of(kobj, struct scst_acg, acg_kobj);
|
||||
|
||||
res = __scst_acg_io_grouping_type_store(acg, buf, count);
|
||||
@@ -5457,6 +5515,8 @@ static ssize_t scst_acg_black_hole_store(struct kobject *kobj,
|
||||
int res;
|
||||
struct scst_acg *acg;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
acg = container_of(kobj, struct scst_acg, acg_kobj);
|
||||
|
||||
res = __scst_acg_black_hole_store(acg, buf, count);
|
||||
@@ -5490,6 +5550,8 @@ static ssize_t scst_acg_cpu_mask_store(struct kobject *kobj,
|
||||
int res;
|
||||
struct scst_acg *acg;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
acg = container_of(kobj, struct scst_acg, acg_kobj);
|
||||
|
||||
res = __scst_acg_cpu_mask_store(acg, buf, count);
|
||||
@@ -5755,6 +5817,8 @@ static ssize_t scst_devt_trace_level_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
devt = container_of(kobj, struct scst_dev_type, devt_kobj);
|
||||
|
||||
res = mutex_lock_interruptible(&scst_log_mutex);
|
||||
@@ -5954,6 +6018,8 @@ static ssize_t __scst_devt_mgmt_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
devt = container_of(kobj, struct scst_dev_type, devt_kobj);
|
||||
|
||||
buffer = kasprintf(GFP_KERNEL, "%.*s", (int)count, buf);
|
||||
@@ -6114,6 +6180,8 @@ static int scst_devt_pass_through_mgmt_store_work_fn(
|
||||
static ssize_t scst_devt_pass_through_mgmt_store(struct kobject *kobj,
|
||||
struct kobj_attribute *attr, const char *buf, size_t count)
|
||||
{
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
return __scst_devt_mgmt_store(kobj, attr, buf, count,
|
||||
scst_devt_pass_through_mgmt_store_work_fn);
|
||||
}
|
||||
@@ -6304,6 +6372,8 @@ static ssize_t scst_dg_devs_mgmt_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = -ENOMEM;
|
||||
cmd = kasprintf(GFP_KERNEL, "%.*s", (int)count, buf);
|
||||
if (!cmd)
|
||||
@@ -6363,6 +6433,9 @@ static ssize_t scst_tg_tgt_rel_tgt_id_store(struct kobject *kobj,
|
||||
int res;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
tg_tgt = container_of(kobj, struct scst_tg_tgt, kobj);
|
||||
snprintf(ch, sizeof(ch), "%.*s", min_t(int, count, sizeof(ch)-1), buf);
|
||||
res = kstrtoul(ch, 0, &rel_tgt_id);
|
||||
@@ -6453,6 +6526,9 @@ static ssize_t scst_tg_group_id_store(struct kobject *kobj,
|
||||
int res;
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
tg = container_of(kobj, struct scst_target_group, kobj);
|
||||
snprintf(ch, sizeof(ch), "%.*s", min_t(int, count, sizeof(ch)-1), buf);
|
||||
res = kstrtoul(ch, 0, &group_id);
|
||||
@@ -6515,6 +6591,8 @@ static ssize_t scst_tg_preferred_store(struct kobject *kobj,
|
||||
struct scst_sysfs_work_item *work;
|
||||
int res;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = -ENOMEM;
|
||||
cmd = kasprintf(GFP_KERNEL, "%.*s", (int)count, buf);
|
||||
if (!cmd)
|
||||
@@ -6596,6 +6674,8 @@ static ssize_t scst_tg_state_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = -ENOMEM;
|
||||
cmd = kasprintf(GFP_KERNEL, "%.*s", (int)count, buf);
|
||||
if (!cmd)
|
||||
@@ -6681,6 +6761,8 @@ static ssize_t scst_tg_mgmt_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = -ENOMEM;
|
||||
cmd = kasprintf(GFP_KERNEL, "%.*s", (int)count, buf);
|
||||
if (!cmd)
|
||||
@@ -6805,6 +6887,8 @@ static ssize_t scst_dg_tgs_mgmt_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = -ENOMEM;
|
||||
cmd = kasprintf(GFP_KERNEL, "%.*s", (int)count, buf);
|
||||
if (!cmd)
|
||||
@@ -6909,6 +6993,8 @@ static ssize_t scst_device_groups_mgmt_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
input = kasprintf(GFP_KERNEL, "%.*s", (int)count, buf);
|
||||
pp = input;
|
||||
p = strchr(input, '\n');
|
||||
@@ -7008,6 +7094,8 @@ static ssize_t scst_measure_latency_store(struct kobject *kobj,
|
||||
long val;
|
||||
int res;
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = kstrtol(buf, 0, &val);
|
||||
if (res < 0)
|
||||
goto out;
|
||||
@@ -7129,6 +7217,8 @@ static ssize_t scst_threads_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = kstrtol(buf, 0, &newtn);
|
||||
if (res != 0) {
|
||||
PRINT_ERROR("kstrtol() for %s failed: %d ", buf, res);
|
||||
@@ -7181,6 +7271,8 @@ static ssize_t scst_setup_id_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = kstrtoul(buf, 0, &val);
|
||||
if (res != 0) {
|
||||
PRINT_ERROR("kstrtoul() for %s failed: %d ", buf, res);
|
||||
@@ -7224,6 +7316,8 @@ static ssize_t scst_max_tasklet_cmd_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = kstrtoul(buf, 0, &val);
|
||||
if (res != 0) {
|
||||
PRINT_ERROR("kstrtoul() for %s failed: %d ", buf, res);
|
||||
@@ -7269,6 +7363,8 @@ static ssize_t scst_poll_us_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = kstrtoul(buf, 0, &val);
|
||||
if (res != 0) {
|
||||
PRINT_ERROR("kstrtoul() for %s failed: %d ", buf, res);
|
||||
@@ -7312,6 +7408,8 @@ static ssize_t scst_suspend_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = kstrtol(buf, 0, &val);
|
||||
if (res != 0) {
|
||||
PRINT_ERROR("kstrtoul() for %s failed: %d ", buf, res);
|
||||
@@ -7356,6 +7454,8 @@ static ssize_t scst_main_trace_level_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = mutex_lock_interruptible(&scst_log_mutex);
|
||||
if (res != 0)
|
||||
goto out;
|
||||
@@ -7391,6 +7491,8 @@ static ssize_t scst_force_global_sgv_pool_store(struct kobject *kobj,
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
PRINT_SYSFS_BUFFER(kobj, attr, buf);
|
||||
|
||||
res = kstrtoul(buf, 0, &v);
|
||||
if (res)
|
||||
goto out;
|
||||
|
||||
Reference in New Issue
Block a user