aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/tcm_fc/tfc_conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/target/tcm_fc/tfc_conf.c')
-rw-r--r--drivers/target/tcm_fc/tfc_conf.c44
1 files changed, 18 insertions, 26 deletions
diff --git a/drivers/target/tcm_fc/tfc_conf.c b/drivers/target/tcm_fc/tfc_conf.c
index 16670933013b..85aeaa0ad303 100644
--- a/drivers/target/tcm_fc/tfc_conf.c
+++ b/drivers/target/tcm_fc/tfc_conf.c
@@ -38,8 +38,6 @@
38 38
39#include <target/target_core_base.h> 39#include <target/target_core_base.h>
40#include <target/target_core_fabric.h> 40#include <target/target_core_fabric.h>
41#include <target/target_core_fabric_configfs.h>
42#include <target/configfs_macros.h>
43 41
44#include "tcm_fc.h" 42#include "tcm_fc.h"
45 43
@@ -131,55 +129,51 @@ static ssize_t ft_wwn_store(void *arg, const char *buf, size_t len)
131 * ACL auth ops. 129 * ACL auth ops.
132 */ 130 */
133 131
134static ssize_t ft_nacl_show_port_name( 132static ssize_t ft_nacl_port_name_show(struct config_item *item, char *page)
135 struct se_node_acl *se_nacl,
136 char *page)
137{ 133{
134 struct se_node_acl *se_nacl = acl_to_nacl(item);
138 struct ft_node_acl *acl = container_of(se_nacl, 135 struct ft_node_acl *acl = container_of(se_nacl,
139 struct ft_node_acl, se_node_acl); 136 struct ft_node_acl, se_node_acl);
140 137
141 return ft_wwn_show(&acl->node_auth.port_name, page); 138 return ft_wwn_show(&acl->node_auth.port_name, page);
142} 139}
143 140
144static ssize_t ft_nacl_store_port_name( 141static ssize_t ft_nacl_port_name_store(struct config_item *item,
145 struct se_node_acl *se_nacl, 142 const char *page, size_t count)
146 const char *page,
147 size_t count)
148{ 143{
144 struct se_node_acl *se_nacl = acl_to_nacl(item);
149 struct ft_node_acl *acl = container_of(se_nacl, 145 struct ft_node_acl *acl = container_of(se_nacl,
150 struct ft_node_acl, se_node_acl); 146 struct ft_node_acl, se_node_acl);
151 147
152 return ft_wwn_store(&acl->node_auth.port_name, page, count); 148 return ft_wwn_store(&acl->node_auth.port_name, page, count);
153} 149}
154 150
155TF_NACL_BASE_ATTR(ft, port_name, S_IRUGO | S_IWUSR); 151static ssize_t ft_nacl_node_name_show(struct config_item *item,
156 152 char *page)
157static ssize_t ft_nacl_show_node_name(
158 struct se_node_acl *se_nacl,
159 char *page)
160{ 153{
154 struct se_node_acl *se_nacl = acl_to_nacl(item);
161 struct ft_node_acl *acl = container_of(se_nacl, 155 struct ft_node_acl *acl = container_of(se_nacl,
162 struct ft_node_acl, se_node_acl); 156 struct ft_node_acl, se_node_acl);
163 157
164 return ft_wwn_show(&acl->node_auth.node_name, page); 158 return ft_wwn_show(&acl->node_auth.node_name, page);
165} 159}
166 160
167static ssize_t ft_nacl_store_node_name( 161static ssize_t ft_nacl_node_name_store(struct config_item *item,
168 struct se_node_acl *se_nacl, 162 const char *page, size_t count)
169 const char *page,
170 size_t count)
171{ 163{
164 struct se_node_acl *se_nacl = acl_to_nacl(item);
172 struct ft_node_acl *acl = container_of(se_nacl, 165 struct ft_node_acl *acl = container_of(se_nacl,
173 struct ft_node_acl, se_node_acl); 166 struct ft_node_acl, se_node_acl);
174 167
175 return ft_wwn_store(&acl->node_auth.node_name, page, count); 168 return ft_wwn_store(&acl->node_auth.node_name, page, count);
176} 169}
177 170
178TF_NACL_BASE_ATTR(ft, node_name, S_IRUGO | S_IWUSR); 171CONFIGFS_ATTR(ft_nacl_, node_name);
172CONFIGFS_ATTR(ft_nacl_, port_name);
179 173
180static struct configfs_attribute *ft_nacl_base_attrs[] = { 174static struct configfs_attribute *ft_nacl_base_attrs[] = {
181 &ft_nacl_port_name.attr, 175 &ft_nacl_attr_port_name,
182 &ft_nacl_node_name.attr, 176 &ft_nacl_attr_node_name,
183 NULL, 177 NULL,
184}; 178};
185 179
@@ -386,18 +380,16 @@ static void ft_del_wwn(struct se_wwn *wwn)
386 kfree(ft_wwn); 380 kfree(ft_wwn);
387} 381}
388 382
389static ssize_t ft_wwn_show_attr_version( 383static ssize_t ft_wwn_version_show(struct config_item *item, char *page)
390 struct target_fabric_configfs *tf,
391 char *page)
392{ 384{
393 return sprintf(page, "TCM FC " FT_VERSION " on %s/%s on " 385 return sprintf(page, "TCM FC " FT_VERSION " on %s/%s on "
394 ""UTS_RELEASE"\n", utsname()->sysname, utsname()->machine); 386 ""UTS_RELEASE"\n", utsname()->sysname, utsname()->machine);
395} 387}
396 388
397TF_WWN_ATTR_RO(ft, version); 389CONFIGFS_ATTR_RO(ft_wwn_, version);
398 390
399static struct configfs_attribute *ft_wwn_attrs[] = { 391static struct configfs_attribute *ft_wwn_attrs[] = {
400 &ft_wwn_version.attr, 392 &ft_wwn_attr_version,
401 NULL, 393 NULL,
402}; 394};
403 395