aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vhost
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-11-13 23:04:17 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2015-11-13 23:04:17 -0500
commit9aa3d651a9199103eb6451aeb0ac1b66a6d770a6 (patch)
tree42cc631c54e1fcbdeedee8e955c4797634a91af7 /drivers/vhost
parent5d2eb548b309be34ecf3b91f0b7300a2b9d09b8c (diff)
parent517982229f78b2aebf00a8a337e84e8eeea70b8e (diff)
Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
Pull SCSI target updates from Nicholas Bellinger: "This series contains HCH's changes to absorb configfs attribute ->show() + ->store() function pointer usage from it's original tree-wide consumers, into common configfs code. It includes usb-gadget, target w/ drivers, netconsole and ocfs2 changes to realize the improved simplicity, that now renders the original include/target/configfs_macros.h CPP magic for fabric drivers and others, unnecessary and obsolete. And with common code in place, new configfs attributes can be added easier than ever before. Note, there are further improvements in-flight from other folks for v4.5 code in configfs land, plus number of target fixes for post -rc1 code" In the meantime, a new user of the now-removed old configfs API came in through the char/misc tree in commit 7bd1d4093c2f ("stm class: Introduce an abstraction for System Trace Module devices"). This merge resolution comes from Alexander Shishkin, who updated his stm class tracing abstraction to account for the removal of the old show_attribute and store_attribute methods in commit 517982229f78 ("configfs: remove old API") from this pull. As Alexander says about that patch: "There's no need to keep an extra wrapper structure per item and the awkward show_attribute/store_attribute item ops are no longer needed. This patch converts policy code to the new api, all the while making the code quite a bit smaller and easier on the eyes. Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>" That patch was folded into the merge so that the tree should be fully bisectable. * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (23 commits) configfs: remove old API ocfs2/cluster: use per-attribute show and store methods ocfs2/cluster: move locking into attribute store methods netconsole: use per-attribute show and store methods target: use per-attribute show and store methods spear13xx_pcie_gadget: use per-attribute show and store methods dlm: use per-attribute show and store methods usb-gadget/f_serial: use per-attribute show and store methods usb-gadget/f_phonet: use per-attribute show and store methods usb-gadget/f_obex: use per-attribute show and store methods usb-gadget/f_uac2: use per-attribute show and store methods usb-gadget/f_uac1: use per-attribute show and store methods usb-gadget/f_mass_storage: use per-attribute show and store methods usb-gadget/f_sourcesink: use per-attribute show and store methods usb-gadget/f_printer: use per-attribute show and store methods usb-gadget/f_midi: use per-attribute show and store methods usb-gadget/f_loopback: use per-attribute show and store methods usb-gadget/ether: use per-attribute show and store methods usb-gadget/f_acm: use per-attribute show and store methods usb-gadget/f_hid: use per-attribute show and store methods ...
Diffstat (limited to 'drivers/vhost')
-rw-r--r--drivers/vhost/scsi.c41
1 files changed, 19 insertions, 22 deletions
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index e25a23692822..29cfc57d496e 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -42,8 +42,6 @@
42#include <scsi/scsi_proto.h> 42#include <scsi/scsi_proto.h>
43#include <target/target_core_base.h> 43#include <target/target_core_base.h>
44#include <target/target_core_fabric.h> 44#include <target/target_core_fabric.h>
45#include <target/target_core_fabric_configfs.h>
46#include <target/configfs_macros.h>
47#include <linux/vhost.h> 45#include <linux/vhost.h>
48#include <linux/virtio_scsi.h> 46#include <linux/virtio_scsi.h>
49#include <linux/llist.h> 47#include <linux/llist.h>
@@ -1684,11 +1682,10 @@ static void vhost_scsi_free_cmd_map_res(struct vhost_scsi_nexus *nexus,
1684 } 1682 }
1685} 1683}
1686 1684
1687static ssize_t vhost_scsi_tpg_attrib_store_fabric_prot_type( 1685static ssize_t vhost_scsi_tpg_attrib_fabric_prot_type_store(
1688 struct se_portal_group *se_tpg, 1686 struct config_item *item, const char *page, size_t count)
1689 const char *page,
1690 size_t count)
1691{ 1687{
1688 struct se_portal_group *se_tpg = attrib_to_tpg(item);
1692 struct vhost_scsi_tpg *tpg = container_of(se_tpg, 1689 struct vhost_scsi_tpg *tpg = container_of(se_tpg,
1693 struct vhost_scsi_tpg, se_tpg); 1690 struct vhost_scsi_tpg, se_tpg);
1694 unsigned long val; 1691 unsigned long val;
@@ -1707,19 +1704,20 @@ static ssize_t vhost_scsi_tpg_attrib_store_fabric_prot_type(
1707 return count; 1704 return count;
1708} 1705}
1709 1706
1710static ssize_t vhost_scsi_tpg_attrib_show_fabric_prot_type( 1707static ssize_t vhost_scsi_tpg_attrib_fabric_prot_type_show(
1711 struct se_portal_group *se_tpg, 1708 struct config_item *item, char *page)
1712 char *page)
1713{ 1709{
1710 struct se_portal_group *se_tpg = attrib_to_tpg(item);
1714 struct vhost_scsi_tpg *tpg = container_of(se_tpg, 1711 struct vhost_scsi_tpg *tpg = container_of(se_tpg,
1715 struct vhost_scsi_tpg, se_tpg); 1712 struct vhost_scsi_tpg, se_tpg);
1716 1713
1717 return sprintf(page, "%d\n", tpg->tv_fabric_prot_type); 1714 return sprintf(page, "%d\n", tpg->tv_fabric_prot_type);
1718} 1715}
1719TF_TPG_ATTRIB_ATTR(vhost_scsi, fabric_prot_type, S_IRUGO | S_IWUSR); 1716
1717CONFIGFS_ATTR(vhost_scsi_tpg_attrib_, fabric_prot_type);
1720 1718
1721static struct configfs_attribute *vhost_scsi_tpg_attrib_attrs[] = { 1719static struct configfs_attribute *vhost_scsi_tpg_attrib_attrs[] = {
1722 &vhost_scsi_tpg_attrib_fabric_prot_type.attr, 1720 &vhost_scsi_tpg_attrib_attr_fabric_prot_type,
1723 NULL, 1721 NULL,
1724}; 1722};
1725 1723
@@ -1867,9 +1865,9 @@ static int vhost_scsi_drop_nexus(struct vhost_scsi_tpg *tpg)
1867 return 0; 1865 return 0;
1868} 1866}
1869 1867
1870static ssize_t vhost_scsi_tpg_show_nexus(struct se_portal_group *se_tpg, 1868static ssize_t vhost_scsi_tpg_nexus_show(struct config_item *item, char *page)
1871 char *page)
1872{ 1869{
1870 struct se_portal_group *se_tpg = to_tpg(item);
1873 struct vhost_scsi_tpg *tpg = container_of(se_tpg, 1871 struct vhost_scsi_tpg *tpg = container_of(se_tpg,
1874 struct vhost_scsi_tpg, se_tpg); 1872 struct vhost_scsi_tpg, se_tpg);
1875 struct vhost_scsi_nexus *tv_nexus; 1873 struct vhost_scsi_nexus *tv_nexus;
@@ -1888,10 +1886,10 @@ static ssize_t vhost_scsi_tpg_show_nexus(struct se_portal_group *se_tpg,
1888 return ret; 1886 return ret;
1889} 1887}
1890 1888
1891static ssize_t vhost_scsi_tpg_store_nexus(struct se_portal_group *se_tpg, 1889static ssize_t vhost_scsi_tpg_nexus_store(struct config_item *item,
1892 const char *page, 1890 const char *page, size_t count)
1893 size_t count)
1894{ 1891{
1892 struct se_portal_group *se_tpg = to_tpg(item);
1895 struct vhost_scsi_tpg *tpg = container_of(se_tpg, 1893 struct vhost_scsi_tpg *tpg = container_of(se_tpg,
1896 struct vhost_scsi_tpg, se_tpg); 1894 struct vhost_scsi_tpg, se_tpg);
1897 struct vhost_scsi_tport *tport_wwn = tpg->tport; 1895 struct vhost_scsi_tport *tport_wwn = tpg->tport;
@@ -1966,10 +1964,10 @@ check_newline:
1966 return count; 1964 return count;
1967} 1965}
1968 1966
1969TF_TPG_BASE_ATTR(vhost_scsi, nexus, S_IRUGO | S_IWUSR); 1967CONFIGFS_ATTR(vhost_scsi_tpg_, nexus);
1970 1968
1971static struct configfs_attribute *vhost_scsi_tpg_attrs[] = { 1969static struct configfs_attribute *vhost_scsi_tpg_attrs[] = {
1972 &vhost_scsi_tpg_nexus.attr, 1970 &vhost_scsi_tpg_attr_nexus,
1973 NULL, 1971 NULL,
1974}; 1972};
1975 1973
@@ -2105,18 +2103,17 @@ static void vhost_scsi_drop_tport(struct se_wwn *wwn)
2105} 2103}
2106 2104
2107static ssize_t 2105static ssize_t
2108vhost_scsi_wwn_show_attr_version(struct target_fabric_configfs *tf, 2106vhost_scsi_wwn_version_show(struct config_item *item, char *page)
2109 char *page)
2110{ 2107{
2111 return sprintf(page, "TCM_VHOST fabric module %s on %s/%s" 2108 return sprintf(page, "TCM_VHOST fabric module %s on %s/%s"
2112 "on "UTS_RELEASE"\n", VHOST_SCSI_VERSION, utsname()->sysname, 2109 "on "UTS_RELEASE"\n", VHOST_SCSI_VERSION, utsname()->sysname,
2113 utsname()->machine); 2110 utsname()->machine);
2114} 2111}
2115 2112
2116TF_WWN_ATTR_RO(vhost_scsi, version); 2113CONFIGFS_ATTR_RO(vhost_scsi_wwn_, version);
2117 2114
2118static struct configfs_attribute *vhost_scsi_wwn_attrs[] = { 2115static struct configfs_attribute *vhost_scsi_wwn_attrs[] = {
2119 &vhost_scsi_wwn_version.attr, 2116 &vhost_scsi_wwn_attr_version,
2120 NULL, 2117 NULL,
2121}; 2118};
2122 2119