diff options
Diffstat (limited to 'drivers/vhost/scsi.c')
-rw-r--r-- | drivers/vhost/scsi.c | 41 |
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 | ||
1687 | static ssize_t vhost_scsi_tpg_attrib_store_fabric_prot_type( | 1685 | static 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 | ||
1710 | static ssize_t vhost_scsi_tpg_attrib_show_fabric_prot_type( | 1707 | static 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 | } |
1719 | TF_TPG_ATTRIB_ATTR(vhost_scsi, fabric_prot_type, S_IRUGO | S_IWUSR); | 1716 | |
1717 | CONFIGFS_ATTR(vhost_scsi_tpg_attrib_, fabric_prot_type); | ||
1720 | 1718 | ||
1721 | static struct configfs_attribute *vhost_scsi_tpg_attrib_attrs[] = { | 1719 | static 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 | ||
1870 | static ssize_t vhost_scsi_tpg_show_nexus(struct se_portal_group *se_tpg, | 1868 | static 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 | ||
1891 | static ssize_t vhost_scsi_tpg_store_nexus(struct se_portal_group *se_tpg, | 1889 | static 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 | ||
1969 | TF_TPG_BASE_ATTR(vhost_scsi, nexus, S_IRUGO | S_IWUSR); | 1967 | CONFIGFS_ATTR(vhost_scsi_tpg_, nexus); |
1970 | 1968 | ||
1971 | static struct configfs_attribute *vhost_scsi_tpg_attrs[] = { | 1969 | static 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 | ||
2107 | static ssize_t | 2105 | static ssize_t |
2108 | vhost_scsi_wwn_show_attr_version(struct target_fabric_configfs *tf, | 2106 | vhost_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 | ||
2116 | TF_WWN_ATTR_RO(vhost_scsi, version); | 2113 | CONFIGFS_ATTR_RO(vhost_scsi_wwn_, version); |
2117 | 2114 | ||
2118 | static struct configfs_attribute *vhost_scsi_wwn_attrs[] = { | 2115 | static 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 | ||