aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen/xen-scsiback.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2015-10-03 09:32:55 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2015-10-14 01:17:49 -0400
commit2eafd72939fda6118e27d3ee859684987f43921b (patch)
treea00a1f5686ec852e04b52ea5fb1ce37c05564dc9 /drivers/xen/xen-scsiback.c
parent64c6be0e6df5b5804613863ca4fb05961948c999 (diff)
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/xen/xen-scsiback.c')
-rw-r--r--drivers/xen/xen-scsiback.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
index 9eeefd7cad41..43bcae852546 100644
--- a/drivers/xen/xen-scsiback.c
+++ b/drivers/xen/xen-scsiback.c
@@ -53,7 +53,6 @@
53 53
54#include <target/target_core_base.h> 54#include <target/target_core_base.h>
55#include <target/target_core_fabric.h> 55#include <target/target_core_fabric.h>
56#include <target/target_core_fabric_configfs.h>
57 56
58#include <asm/hypervisor.h> 57#include <asm/hypervisor.h>
59 58
@@ -1438,9 +1437,10 @@ static void scsiback_aborted_task(struct se_cmd *se_cmd)
1438{ 1437{
1439} 1438}
1440 1439
1441static ssize_t scsiback_tpg_param_show_alias(struct se_portal_group *se_tpg, 1440static ssize_t scsiback_tpg_param_alias_show(struct config_item *item,
1442 char *page) 1441 char *page)
1443{ 1442{
1443 struct se_portal_group *se_tpg = param_to_tpg(item);
1444 struct scsiback_tpg *tpg = container_of(se_tpg, struct scsiback_tpg, 1444 struct scsiback_tpg *tpg = container_of(se_tpg, struct scsiback_tpg,
1445 se_tpg); 1445 se_tpg);
1446 ssize_t rb; 1446 ssize_t rb;
@@ -1452,9 +1452,10 @@ static ssize_t scsiback_tpg_param_show_alias(struct se_portal_group *se_tpg,
1452 return rb; 1452 return rb;
1453} 1453}
1454 1454
1455static ssize_t scsiback_tpg_param_store_alias(struct se_portal_group *se_tpg, 1455static ssize_t scsiback_tpg_param_alias_store(struct config_item *item,
1456 const char *page, size_t count) 1456 const char *page, size_t count)
1457{ 1457{
1458 struct se_portal_group *se_tpg = param_to_tpg(item);
1458 struct scsiback_tpg *tpg = container_of(se_tpg, struct scsiback_tpg, 1459 struct scsiback_tpg *tpg = container_of(se_tpg, struct scsiback_tpg,
1459 se_tpg); 1460 se_tpg);
1460 int len; 1461 int len;
@@ -1474,10 +1475,10 @@ static ssize_t scsiback_tpg_param_store_alias(struct se_portal_group *se_tpg,
1474 return count; 1475 return count;
1475} 1476}
1476 1477
1477TF_TPG_PARAM_ATTR(scsiback, alias, S_IRUGO | S_IWUSR); 1478CONFIGFS_ATTR(scsiback_tpg_param_, alias);
1478 1479
1479static struct configfs_attribute *scsiback_param_attrs[] = { 1480static struct configfs_attribute *scsiback_param_attrs[] = {
1480 &scsiback_tpg_param_alias.attr, 1481 &scsiback_tpg_param_attr_alias,
1481 NULL, 1482 NULL,
1482}; 1483};
1483 1484
@@ -1585,9 +1586,9 @@ static int scsiback_drop_nexus(struct scsiback_tpg *tpg)
1585 return 0; 1586 return 0;
1586} 1587}
1587 1588
1588static ssize_t scsiback_tpg_show_nexus(struct se_portal_group *se_tpg, 1589static ssize_t scsiback_tpg_nexus_show(struct config_item *item, char *page)
1589 char *page)
1590{ 1590{
1591 struct se_portal_group *se_tpg = to_tpg(item);
1591 struct scsiback_tpg *tpg = container_of(se_tpg, 1592 struct scsiback_tpg *tpg = container_of(se_tpg,
1592 struct scsiback_tpg, se_tpg); 1593 struct scsiback_tpg, se_tpg);
1593 struct scsiback_nexus *tv_nexus; 1594 struct scsiback_nexus *tv_nexus;
@@ -1606,10 +1607,10 @@ static ssize_t scsiback_tpg_show_nexus(struct se_portal_group *se_tpg,
1606 return ret; 1607 return ret;
1607} 1608}
1608 1609
1609static ssize_t scsiback_tpg_store_nexus(struct se_portal_group *se_tpg, 1610static ssize_t scsiback_tpg_nexus_store(struct config_item *item,
1610 const char *page, 1611 const char *page, size_t count)
1611 size_t count)
1612{ 1612{
1613 struct se_portal_group *se_tpg = to_tpg(item);
1613 struct scsiback_tpg *tpg = container_of(se_tpg, 1614 struct scsiback_tpg *tpg = container_of(se_tpg,
1614 struct scsiback_tpg, se_tpg); 1615 struct scsiback_tpg, se_tpg);
1615 struct scsiback_tport *tport_wwn = tpg->tport; 1616 struct scsiback_tport *tport_wwn = tpg->tport;
@@ -1681,26 +1682,25 @@ check_newline:
1681 return count; 1682 return count;
1682} 1683}
1683 1684
1684TF_TPG_BASE_ATTR(scsiback, nexus, S_IRUGO | S_IWUSR); 1685CONFIGFS_ATTR(scsiback_tpg_, nexus);
1685 1686
1686static struct configfs_attribute *scsiback_tpg_attrs[] = { 1687static struct configfs_attribute *scsiback_tpg_attrs[] = {
1687 &scsiback_tpg_nexus.attr, 1688 &scsiback_tpg_attr_nexus,
1688 NULL, 1689 NULL,
1689}; 1690};
1690 1691
1691static ssize_t 1692static ssize_t
1692scsiback_wwn_show_attr_version(struct target_fabric_configfs *tf, 1693scsiback_wwn_version_show(struct config_item *item, char *page)
1693 char *page)
1694{ 1694{
1695 return sprintf(page, "xen-pvscsi fabric module %s on %s/%s on " 1695 return sprintf(page, "xen-pvscsi fabric module %s on %s/%s on "
1696 UTS_RELEASE"\n", 1696 UTS_RELEASE"\n",
1697 VSCSI_VERSION, utsname()->sysname, utsname()->machine); 1697 VSCSI_VERSION, utsname()->sysname, utsname()->machine);
1698} 1698}
1699 1699
1700TF_WWN_ATTR_RO(scsiback, version); 1700CONFIGFS_ATTR_RO(scsiback_wwn_, version);
1701 1701
1702static struct configfs_attribute *scsiback_wwn_attrs[] = { 1702static struct configfs_attribute *scsiback_wwn_attrs[] = {
1703 &scsiback_wwn_version.attr, 1703 &scsiback_wwn_attr_version,
1704 NULL, 1704 NULL,
1705}; 1705};
1706 1706