diff options
author | Christoph Hellwig <hch@lst.de> | 2015-10-03 15:32:55 +0200 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-10-13 22:17:49 -0700 |
commit | 2eafd72939fda6118e27d3ee859684987f43921b (patch) | |
tree | a00a1f5686ec852e04b52ea5fb1ce37c05564dc9 /drivers/target/tcm_fc | |
parent | 64c6be0e6df5b5804613863ca4fb05961948c999 (diff) | |
download | linux-2eafd72939fda6118e27d3ee859684987f43921b.tar.gz linux-2eafd72939fda6118e27d3ee859684987f43921b.tar.bz2 linux-2eafd72939fda6118e27d3ee859684987f43921b.zip |
target: use per-attribute show and store methods
This also allows to remove the target-specific old configfs macros, and
gets rid of the target_core_fabric_configfs.h header which only had one
function declaration left that could be moved to a better place.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Nicholas Bellinger <nab@linux-iscsi.org>
Acked-by: Nicholas Bellinger <nab@linux-iscsi.org>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/tcm_fc')
-rw-r--r-- | drivers/target/tcm_fc/tfc_cmd.c | 1 | ||||
-rw-r--r-- | drivers/target/tcm_fc/tfc_conf.c | 44 | ||||
-rw-r--r-- | drivers/target/tcm_fc/tfc_io.c | 1 | ||||
-rw-r--r-- | drivers/target/tcm_fc/tfc_sess.c | 1 |
4 files changed, 18 insertions, 29 deletions
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c index aa3caca8bace..064d6dfb5b6d 100644 --- a/drivers/target/tcm_fc/tfc_cmd.c +++ b/drivers/target/tcm_fc/tfc_cmd.c @@ -36,7 +36,6 @@ #include <target/target_core_base.h> #include <target/target_core_fabric.h> -#include <target/configfs_macros.h> #include "tcm_fc.h" 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 @@ #include <target/target_core_base.h> #include <target/target_core_fabric.h> -#include <target/target_core_fabric_configfs.h> -#include <target/configfs_macros.h> #include "tcm_fc.h" @@ -131,55 +129,51 @@ static ssize_t ft_wwn_store(void *arg, const char *buf, size_t len) * ACL auth ops. */ -static ssize_t ft_nacl_show_port_name( - struct se_node_acl *se_nacl, - char *page) +static ssize_t ft_nacl_port_name_show(struct config_item *item, char *page) { + struct se_node_acl *se_nacl = acl_to_nacl(item); struct ft_node_acl *acl = container_of(se_nacl, struct ft_node_acl, se_node_acl); return ft_wwn_show(&acl->node_auth.port_name, page); } -static ssize_t ft_nacl_store_port_name( - struct se_node_acl *se_nacl, - const char *page, - size_t count) +static ssize_t ft_nacl_port_name_store(struct config_item *item, + const char *page, size_t count) { + struct se_node_acl *se_nacl = acl_to_nacl(item); struct ft_node_acl *acl = container_of(se_nacl, struct ft_node_acl, se_node_acl); return ft_wwn_store(&acl->node_auth.port_name, page, count); } -TF_NACL_BASE_ATTR(ft, port_name, S_IRUGO | S_IWUSR); - -static ssize_t ft_nacl_show_node_name( - struct se_node_acl *se_nacl, - char *page) +static ssize_t ft_nacl_node_name_show(struct config_item *item, + char *page) { + struct se_node_acl *se_nacl = acl_to_nacl(item); struct ft_node_acl *acl = container_of(se_nacl, struct ft_node_acl, se_node_acl); return ft_wwn_show(&acl->node_auth.node_name, page); } -static ssize_t ft_nacl_store_node_name( - struct se_node_acl *se_nacl, - const char *page, - size_t count) +static ssize_t ft_nacl_node_name_store(struct config_item *item, + const char *page, size_t count) { + struct se_node_acl *se_nacl = acl_to_nacl(item); struct ft_node_acl *acl = container_of(se_nacl, struct ft_node_acl, se_node_acl); return ft_wwn_store(&acl->node_auth.node_name, page, count); } -TF_NACL_BASE_ATTR(ft, node_name, S_IRUGO | S_IWUSR); +CONFIGFS_ATTR(ft_nacl_, node_name); +CONFIGFS_ATTR(ft_nacl_, port_name); static struct configfs_attribute *ft_nacl_base_attrs[] = { - &ft_nacl_port_name.attr, - &ft_nacl_node_name.attr, + &ft_nacl_attr_port_name, + &ft_nacl_attr_node_name, NULL, }; @@ -386,18 +380,16 @@ static void ft_del_wwn(struct se_wwn *wwn) kfree(ft_wwn); } -static ssize_t ft_wwn_show_attr_version( - struct target_fabric_configfs *tf, - char *page) +static ssize_t ft_wwn_version_show(struct config_item *item, char *page) { return sprintf(page, "TCM FC " FT_VERSION " on %s/%s on " ""UTS_RELEASE"\n", utsname()->sysname, utsname()->machine); } -TF_WWN_ATTR_RO(ft, version); +CONFIGFS_ATTR_RO(ft_wwn_, version); static struct configfs_attribute *ft_wwn_attrs[] = { - &ft_wwn_version.attr, + &ft_wwn_attr_version, NULL, }; diff --git a/drivers/target/tcm_fc/tfc_io.c b/drivers/target/tcm_fc/tfc_io.c index 4b0fedd6bd4b..847c1aa6fbf4 100644 --- a/drivers/target/tcm_fc/tfc_io.c +++ b/drivers/target/tcm_fc/tfc_io.c @@ -44,7 +44,6 @@ #include <target/target_core_base.h> #include <target/target_core_fabric.h> -#include <target/configfs_macros.h> #include "tcm_fc.h" diff --git a/drivers/target/tcm_fc/tfc_sess.c b/drivers/target/tcm_fc/tfc_sess.c index 31a9e3fb98c5..7b934eac995d 100644 --- a/drivers/target/tcm_fc/tfc_sess.c +++ b/drivers/target/tcm_fc/tfc_sess.c @@ -36,7 +36,6 @@ #include <target/target_core_base.h> #include <target/target_core_fabric.h> -#include <target/configfs_macros.h> #include "tcm_fc.h" |