From 9383e778e6032e3f7f854f704aa55ff937936963 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 15 Dec 2010 13:24:46 +0000 Subject: [PATCH] scst/sysfs: Moved sysfs attribute definitions immediately after the corresponding method definitions. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3078 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_sysfs.c | 71 +++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/scst/src/scst_sysfs.c b/scst/src/scst_sysfs.c index aee8a03f6..06a6fc22e 100644 --- a/scst/src/scst_sysfs.c +++ b/scst/src/scst_sysfs.c @@ -1403,6 +1403,10 @@ static ssize_t scst_luns_mgmt_store(struct kobject *kobj, return res; } +static struct kobj_attribute scst_luns_mgmt = + __ATTR(mgmt, S_IRUGO | S_IWUSR, scst_luns_mgmt_show, + scst_luns_mgmt_store); + static ssize_t __scst_acg_addr_method_show(struct scst_acg *acg, char *buf) { int res; @@ -1477,6 +1481,10 @@ static ssize_t scst_tgt_addr_method_store(struct kobject *kobj, return res; } +static struct kobj_attribute scst_tgt_addr_method = + __ATTR(addr_method, S_IRUGO | S_IWUSR, scst_tgt_addr_method_show, + scst_tgt_addr_method_store); + static ssize_t __scst_acg_io_grouping_type_show(struct scst_acg *acg, char *buf) { int res; @@ -1630,6 +1638,11 @@ out: return res; } +static struct kobj_attribute scst_tgt_io_grouping_type = + __ATTR(io_grouping_type, S_IRUGO | S_IWUSR, + scst_tgt_io_grouping_type_show, + scst_tgt_io_grouping_type_store); + static ssize_t __scst_acg_cpu_mask_show(struct scst_acg *acg, char *buf) { int res; @@ -1796,6 +1809,11 @@ out: return res; } +static struct kobj_attribute scst_tgt_cpu_mask = + __ATTR(cpu_mask, S_IRUGO | S_IWUSR, + scst_tgt_cpu_mask_show, + scst_tgt_cpu_mask_store); + static ssize_t scst_ini_group_mgmt_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { @@ -1959,24 +1977,6 @@ static struct kobj_attribute scst_ini_group_mgmt = __ATTR(mgmt, S_IRUGO | S_IWUSR, scst_ini_group_mgmt_show, scst_ini_group_mgmt_store); -static struct kobj_attribute scst_luns_mgmt = - __ATTR(mgmt, S_IRUGO | S_IWUSR, scst_luns_mgmt_show, - scst_luns_mgmt_store); - -static struct kobj_attribute scst_tgt_addr_method = - __ATTR(addr_method, S_IRUGO | S_IWUSR, scst_tgt_addr_method_show, - scst_tgt_addr_method_store); - -static struct kobj_attribute scst_tgt_io_grouping_type = - __ATTR(io_grouping_type, S_IRUGO | S_IWUSR, - scst_tgt_io_grouping_type_show, - scst_tgt_io_grouping_type_store); - -static struct kobj_attribute scst_tgt_cpu_mask = - __ATTR(cpu_mask, S_IRUGO | S_IWUSR, - scst_tgt_cpu_mask_show, - scst_tgt_cpu_mask_store); - static ssize_t scst_tgt_enable_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { @@ -3398,7 +3398,8 @@ static ssize_t scst_sess_sysfs_initiator_name_show(struct kobject *kobj, } static struct kobj_attribute session_initiator_name_attr = - __ATTR(initiator_name, S_IRUGO, scst_sess_sysfs_initiator_name_show, NULL); + __ATTR(initiator_name, S_IRUGO, scst_sess_sysfs_initiator_name_show, + NULL); static struct attribute *scst_session_attrs[] = { &session_commands_attr.attr, @@ -4928,6 +4929,10 @@ out: return res; } +static struct kobj_attribute scst_threads_attr = + __ATTR(threads, S_IRUGO | S_IWUSR, scst_threads_show, + scst_threads_store); + static ssize_t scst_setup_id_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { @@ -4966,6 +4971,10 @@ out: return res; } +static struct kobj_attribute scst_setup_id_attr = + __ATTR(setup_id, S_IRUGO | S_IWUSR, scst_setup_id_show, + scst_setup_id_store); + #if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) static ssize_t scst_main_trace_level_show(struct kobject *kobj, @@ -4996,6 +5005,10 @@ out: return res; } +static struct kobj_attribute scst_trace_level_attr = + __ATTR(trace_level, S_IRUGO | S_IWUSR, scst_main_trace_level_show, + scst_main_trace_level_store); + #endif /* defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) */ static ssize_t scst_version_show(struct kobject *kobj, @@ -5054,6 +5067,9 @@ static ssize_t scst_version_show(struct kobject *kobj, return strlen(buf); } +static struct kobj_attribute scst_version_attr = + __ATTR(version, S_IRUGO, scst_version_show, NULL); + static ssize_t scst_last_sysfs_mgmt_res_show(struct kobject *kobj, struct kobj_attribute *attr, char *buf) { @@ -5073,23 +5089,6 @@ static ssize_t scst_last_sysfs_mgmt_res_show(struct kobject *kobj, return res; } -static struct kobj_attribute scst_threads_attr = - __ATTR(threads, S_IRUGO | S_IWUSR, scst_threads_show, - scst_threads_store); - -static struct kobj_attribute scst_setup_id_attr = - __ATTR(setup_id, S_IRUGO | S_IWUSR, scst_setup_id_show, - scst_setup_id_store); - -#if defined(CONFIG_SCST_DEBUG) || defined(CONFIG_SCST_TRACING) -static struct kobj_attribute scst_trace_level_attr = - __ATTR(trace_level, S_IRUGO | S_IWUSR, scst_main_trace_level_show, - scst_main_trace_level_store); -#endif - -static struct kobj_attribute scst_version_attr = - __ATTR(version, S_IRUGO, scst_version_show, NULL); - static struct kobj_attribute scst_last_sysfs_mgmt_res_attr = __ATTR(last_sysfs_mgmt_res, S_IRUGO, scst_last_sysfs_mgmt_res_show, NULL);