aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/loopback/tcm_loop.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/target/loopback/tcm_loop.c')
-rw-r--r--drivers/target/loopback/tcm_loop.c60
1 files changed, 26 insertions, 34 deletions
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index 5bc85ffed720..999b6eba52e8 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -34,7 +34,6 @@
34 34
35#include <target/target_core_base.h> 35#include <target/target_core_base.h>
36#include <target/target_core_fabric.h> 36#include <target/target_core_fabric.h>
37#include <target/target_core_fabric_configfs.h>
38 37
39#include "tcm_loop.h" 38#include "tcm_loop.h"
40 39
@@ -763,21 +762,20 @@ static void tcm_loop_port_unlink(
763 762
764/* End items for tcm_loop_port_cit */ 763/* End items for tcm_loop_port_cit */
765 764
766static ssize_t tcm_loop_tpg_attrib_show_fabric_prot_type( 765static ssize_t tcm_loop_tpg_attrib_fabric_prot_type_show(
767 struct se_portal_group *se_tpg, 766 struct config_item *item, char *page)
768 char *page)
769{ 767{
768 struct se_portal_group *se_tpg = attrib_to_tpg(item);
770 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, 769 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg,
771 tl_se_tpg); 770 tl_se_tpg);
772 771
773 return sprintf(page, "%d\n", tl_tpg->tl_fabric_prot_type); 772 return sprintf(page, "%d\n", tl_tpg->tl_fabric_prot_type);
774} 773}
775 774
776static ssize_t tcm_loop_tpg_attrib_store_fabric_prot_type( 775static ssize_t tcm_loop_tpg_attrib_fabric_prot_type_store(
777 struct se_portal_group *se_tpg, 776 struct config_item *item, const char *page, size_t count)
778 const char *page,
779 size_t count)
780{ 777{
778 struct se_portal_group *se_tpg = attrib_to_tpg(item);
781 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg, 779 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, struct tcm_loop_tpg,
782 tl_se_tpg); 780 tl_se_tpg);
783 unsigned long val; 781 unsigned long val;
@@ -796,10 +794,10 @@ static ssize_t tcm_loop_tpg_attrib_store_fabric_prot_type(
796 return count; 794 return count;
797} 795}
798 796
799TF_TPG_ATTRIB_ATTR(tcm_loop, fabric_prot_type, S_IRUGO | S_IWUSR); 797CONFIGFS_ATTR(tcm_loop_tpg_attrib_, fabric_prot_type);
800 798
801static struct configfs_attribute *tcm_loop_tpg_attrib_attrs[] = { 799static struct configfs_attribute *tcm_loop_tpg_attrib_attrs[] = {
802 &tcm_loop_tpg_attrib_fabric_prot_type.attr, 800 &tcm_loop_tpg_attrib_attr_fabric_prot_type,
803 NULL, 801 NULL,
804}; 802};
805 803
@@ -894,10 +892,9 @@ static int tcm_loop_drop_nexus(
894 892
895/* End items for tcm_loop_nexus_cit */ 893/* End items for tcm_loop_nexus_cit */
896 894
897static ssize_t tcm_loop_tpg_show_nexus( 895static ssize_t tcm_loop_tpg_nexus_show(struct config_item *item, char *page)
898 struct se_portal_group *se_tpg,
899 char *page)
900{ 896{
897 struct se_portal_group *se_tpg = to_tpg(item);
901 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, 898 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
902 struct tcm_loop_tpg, tl_se_tpg); 899 struct tcm_loop_tpg, tl_se_tpg);
903 struct tcm_loop_nexus *tl_nexus; 900 struct tcm_loop_nexus *tl_nexus;
@@ -913,11 +910,10 @@ static ssize_t tcm_loop_tpg_show_nexus(
913 return ret; 910 return ret;
914} 911}
915 912
916static ssize_t tcm_loop_tpg_store_nexus( 913static ssize_t tcm_loop_tpg_nexus_store(struct config_item *item,
917 struct se_portal_group *se_tpg, 914 const char *page, size_t count)
918 const char *page,
919 size_t count)
920{ 915{
916 struct se_portal_group *se_tpg = to_tpg(item);
921 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, 917 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
922 struct tcm_loop_tpg, tl_se_tpg); 918 struct tcm_loop_tpg, tl_se_tpg);
923 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; 919 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba;
@@ -992,12 +988,10 @@ check_newline:
992 return count; 988 return count;
993} 989}
994 990
995TF_TPG_BASE_ATTR(tcm_loop, nexus, S_IRUGO | S_IWUSR); 991static ssize_t tcm_loop_tpg_transport_status_show(struct config_item *item,
996 992 char *page)
997static ssize_t tcm_loop_tpg_show_transport_status(
998 struct se_portal_group *se_tpg,
999 char *page)
1000{ 993{
994 struct se_portal_group *se_tpg = to_tpg(item);
1001 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, 995 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
1002 struct tcm_loop_tpg, tl_se_tpg); 996 struct tcm_loop_tpg, tl_se_tpg);
1003 const char *status = NULL; 997 const char *status = NULL;
@@ -1020,11 +1014,10 @@ static ssize_t tcm_loop_tpg_show_transport_status(
1020 return ret; 1014 return ret;
1021} 1015}
1022 1016
1023static ssize_t tcm_loop_tpg_store_transport_status( 1017static ssize_t tcm_loop_tpg_transport_status_store(struct config_item *item,
1024 struct se_portal_group *se_tpg, 1018 const char *page, size_t count)
1025 const char *page,
1026 size_t count)
1027{ 1019{
1020 struct se_portal_group *se_tpg = to_tpg(item);
1028 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg, 1021 struct tcm_loop_tpg *tl_tpg = container_of(se_tpg,
1029 struct tcm_loop_tpg, tl_se_tpg); 1022 struct tcm_loop_tpg, tl_se_tpg);
1030 1023
@@ -1044,11 +1037,12 @@ static ssize_t tcm_loop_tpg_store_transport_status(
1044 return -EINVAL; 1037 return -EINVAL;
1045} 1038}
1046 1039
1047TF_TPG_BASE_ATTR(tcm_loop, transport_status, S_IRUGO | S_IWUSR); 1040CONFIGFS_ATTR(tcm_loop_tpg_, nexus);
1041CONFIGFS_ATTR(tcm_loop_tpg_, transport_status);
1048 1042
1049static struct configfs_attribute *tcm_loop_tpg_attrs[] = { 1043static struct configfs_attribute *tcm_loop_tpg_attrs[] = {
1050 &tcm_loop_tpg_nexus.attr, 1044 &tcm_loop_tpg_attr_nexus,
1051 &tcm_loop_tpg_transport_status.attr, 1045 &tcm_loop_tpg_attr_transport_status,
1052 NULL, 1046 NULL,
1053}; 1047};
1054 1048
@@ -1216,17 +1210,15 @@ static void tcm_loop_drop_scsi_hba(
1216} 1210}
1217 1211
1218/* Start items for tcm_loop_cit */ 1212/* Start items for tcm_loop_cit */
1219static ssize_t tcm_loop_wwn_show_attr_version( 1213static ssize_t tcm_loop_wwn_version_show(struct config_item *item, char *page)
1220 struct target_fabric_configfs *tf,
1221 char *page)
1222{ 1214{
1223 return sprintf(page, "TCM Loopback Fabric module %s\n", TCM_LOOP_VERSION); 1215 return sprintf(page, "TCM Loopback Fabric module %s\n", TCM_LOOP_VERSION);
1224} 1216}
1225 1217
1226TF_WWN_ATTR_RO(tcm_loop, version); 1218CONFIGFS_ATTR_RO(tcm_loop_wwn_, version);
1227 1219
1228static struct configfs_attribute *tcm_loop_wwn_attrs[] = { 1220static struct configfs_attribute *tcm_loop_wwn_attrs[] = {
1229 &tcm_loop_wwn_version.attr, 1221 &tcm_loop_wwn_attr_version,
1230 NULL, 1222 NULL,
1231}; 1223};
1232 1224