diff options
author | Andy Grover <agrover@redhat.com> | 2013-10-09 14:05:57 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-10-16 16:38:09 -0400 |
commit | b7eec2cdd874ad678228a32a31dea32e3fcc2f99 (patch) | |
tree | f7219e52d84e1bdf10856f9add41bb3dda639595 /drivers/target/iscsi | |
parent | d80e224dd52dfc448e820aefa5f86c441ab76e1a (diff) |
target/iscsi: Remove iscsi dereferencing macros
These are all straightforward.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/iscsi')
-rw-r--r-- | drivers/target/iscsi/iscsi_target_configfs.c | 42 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_core.h | 9 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_nego.c | 8 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_tpg.c | 4 |
4 files changed, 27 insertions, 36 deletions
diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index c2d504425da6..59a0241a016d 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c | |||
@@ -372,7 +372,7 @@ static ssize_t iscsi_nacl_attrib_show_##name( \ | |||
372 | struct iscsi_node_acl *nacl = container_of(se_nacl, struct iscsi_node_acl, \ | 372 | struct iscsi_node_acl *nacl = container_of(se_nacl, struct iscsi_node_acl, \ |
373 | se_node_acl); \ | 373 | se_node_acl); \ |
374 | \ | 374 | \ |
375 | return sprintf(page, "%u\n", ISCSI_NODE_ATTRIB(nacl)->name); \ | 375 | return sprintf(page, "%u\n", nacl->node_attrib.name); \ |
376 | } \ | 376 | } \ |
377 | \ | 377 | \ |
378 | static ssize_t iscsi_nacl_attrib_store_##name( \ | 378 | static ssize_t iscsi_nacl_attrib_store_##name( \ |
@@ -897,7 +897,7 @@ static struct se_node_acl *lio_target_make_nodeacl( | |||
897 | if (!se_nacl_new) | 897 | if (!se_nacl_new) |
898 | return ERR_PTR(-ENOMEM); | 898 | return ERR_PTR(-ENOMEM); |
899 | 899 | ||
900 | cmdsn_depth = ISCSI_TPG_ATTRIB(tpg)->default_cmdsn_depth; | 900 | cmdsn_depth = tpg->tpg_attrib.default_cmdsn_depth; |
901 | /* | 901 | /* |
902 | * se_nacl_new may be released by core_tpg_add_initiator_node_acl() | 902 | * se_nacl_new may be released by core_tpg_add_initiator_node_acl() |
903 | * when converting a NdoeACL from demo mode -> explict | 903 | * when converting a NdoeACL from demo mode -> explict |
@@ -920,9 +920,9 @@ static struct se_node_acl *lio_target_make_nodeacl( | |||
920 | return ERR_PTR(-ENOMEM); | 920 | return ERR_PTR(-ENOMEM); |
921 | } | 921 | } |
922 | 922 | ||
923 | stats_cg->default_groups[0] = &NODE_STAT_GRPS(acl)->iscsi_sess_stats_group; | 923 | stats_cg->default_groups[0] = &acl->node_stat_grps.iscsi_sess_stats_group; |
924 | stats_cg->default_groups[1] = NULL; | 924 | stats_cg->default_groups[1] = NULL; |
925 | config_group_init_type_name(&NODE_STAT_GRPS(acl)->iscsi_sess_stats_group, | 925 | config_group_init_type_name(&acl->node_stat_grps.iscsi_sess_stats_group, |
926 | "iscsi_sess_stats", &iscsi_stat_sess_cit); | 926 | "iscsi_sess_stats", &iscsi_stat_sess_cit); |
927 | 927 | ||
928 | return se_nacl; | 928 | return se_nacl; |
@@ -967,7 +967,7 @@ static ssize_t iscsi_tpg_attrib_show_##name( \ | |||
967 | if (iscsit_get_tpg(tpg) < 0) \ | 967 | if (iscsit_get_tpg(tpg) < 0) \ |
968 | return -EINVAL; \ | 968 | return -EINVAL; \ |
969 | \ | 969 | \ |
970 | rb = sprintf(page, "%u\n", ISCSI_TPG_ATTRIB(tpg)->name); \ | 970 | rb = sprintf(page, "%u\n", tpg->tpg_attrib.name); \ |
971 | iscsit_put_tpg(tpg); \ | 971 | iscsit_put_tpg(tpg); \ |
972 | return rb; \ | 972 | return rb; \ |
973 | } \ | 973 | } \ |
@@ -1514,21 +1514,21 @@ static struct se_wwn *lio_target_call_coreaddtiqn( | |||
1514 | return ERR_PTR(-ENOMEM); | 1514 | return ERR_PTR(-ENOMEM); |
1515 | } | 1515 | } |
1516 | 1516 | ||
1517 | stats_cg->default_groups[0] = &WWN_STAT_GRPS(tiqn)->iscsi_instance_group; | 1517 | stats_cg->default_groups[0] = &tiqn->tiqn_stat_grps.iscsi_instance_group; |
1518 | stats_cg->default_groups[1] = &WWN_STAT_GRPS(tiqn)->iscsi_sess_err_group; | 1518 | stats_cg->default_groups[1] = &tiqn->tiqn_stat_grps.iscsi_sess_err_group; |
1519 | stats_cg->default_groups[2] = &WWN_STAT_GRPS(tiqn)->iscsi_tgt_attr_group; | 1519 | stats_cg->default_groups[2] = &tiqn->tiqn_stat_grps.iscsi_tgt_attr_group; |
1520 | stats_cg->default_groups[3] = &WWN_STAT_GRPS(tiqn)->iscsi_login_stats_group; | 1520 | stats_cg->default_groups[3] = &tiqn->tiqn_stat_grps.iscsi_login_stats_group; |
1521 | stats_cg->default_groups[4] = &WWN_STAT_GRPS(tiqn)->iscsi_logout_stats_group; | 1521 | stats_cg->default_groups[4] = &tiqn->tiqn_stat_grps.iscsi_logout_stats_group; |
1522 | stats_cg->default_groups[5] = NULL; | 1522 | stats_cg->default_groups[5] = NULL; |
1523 | config_group_init_type_name(&WWN_STAT_GRPS(tiqn)->iscsi_instance_group, | 1523 | config_group_init_type_name(&tiqn->tiqn_stat_grps.iscsi_instance_group, |
1524 | "iscsi_instance", &iscsi_stat_instance_cit); | 1524 | "iscsi_instance", &iscsi_stat_instance_cit); |
1525 | config_group_init_type_name(&WWN_STAT_GRPS(tiqn)->iscsi_sess_err_group, | 1525 | config_group_init_type_name(&tiqn->tiqn_stat_grps.iscsi_sess_err_group, |
1526 | "iscsi_sess_err", &iscsi_stat_sess_err_cit); | 1526 | "iscsi_sess_err", &iscsi_stat_sess_err_cit); |
1527 | config_group_init_type_name(&WWN_STAT_GRPS(tiqn)->iscsi_tgt_attr_group, | 1527 | config_group_init_type_name(&tiqn->tiqn_stat_grps.iscsi_tgt_attr_group, |
1528 | "iscsi_tgt_attr", &iscsi_stat_tgt_attr_cit); | 1528 | "iscsi_tgt_attr", &iscsi_stat_tgt_attr_cit); |
1529 | config_group_init_type_name(&WWN_STAT_GRPS(tiqn)->iscsi_login_stats_group, | 1529 | config_group_init_type_name(&tiqn->tiqn_stat_grps.iscsi_login_stats_group, |
1530 | "iscsi_login_stats", &iscsi_stat_login_cit); | 1530 | "iscsi_login_stats", &iscsi_stat_login_cit); |
1531 | config_group_init_type_name(&WWN_STAT_GRPS(tiqn)->iscsi_logout_stats_group, | 1531 | config_group_init_type_name(&tiqn->tiqn_stat_grps.iscsi_logout_stats_group, |
1532 | "iscsi_logout_stats", &iscsi_stat_logout_cit); | 1532 | "iscsi_logout_stats", &iscsi_stat_logout_cit); |
1533 | 1533 | ||
1534 | pr_debug("LIO_Target_ConfigFS: REGISTER -> %s\n", tiqn->tiqn); | 1534 | pr_debug("LIO_Target_ConfigFS: REGISTER -> %s\n", tiqn->tiqn); |
@@ -1815,21 +1815,21 @@ static u32 lio_tpg_get_default_depth(struct se_portal_group *se_tpg) | |||
1815 | { | 1815 | { |
1816 | struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr; | 1816 | struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr; |
1817 | 1817 | ||
1818 | return ISCSI_TPG_ATTRIB(tpg)->default_cmdsn_depth; | 1818 | return tpg->tpg_attrib.default_cmdsn_depth; |
1819 | } | 1819 | } |
1820 | 1820 | ||
1821 | static int lio_tpg_check_demo_mode(struct se_portal_group *se_tpg) | 1821 | static int lio_tpg_check_demo_mode(struct se_portal_group *se_tpg) |
1822 | { | 1822 | { |
1823 | struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr; | 1823 | struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr; |
1824 | 1824 | ||
1825 | return ISCSI_TPG_ATTRIB(tpg)->generate_node_acls; | 1825 | return tpg->tpg_attrib.generate_node_acls; |
1826 | } | 1826 | } |
1827 | 1827 | ||
1828 | static int lio_tpg_check_demo_mode_cache(struct se_portal_group *se_tpg) | 1828 | static int lio_tpg_check_demo_mode_cache(struct se_portal_group *se_tpg) |
1829 | { | 1829 | { |
1830 | struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr; | 1830 | struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr; |
1831 | 1831 | ||
1832 | return ISCSI_TPG_ATTRIB(tpg)->cache_dynamic_acls; | 1832 | return tpg->tpg_attrib.cache_dynamic_acls; |
1833 | } | 1833 | } |
1834 | 1834 | ||
1835 | static int lio_tpg_check_demo_mode_write_protect( | 1835 | static int lio_tpg_check_demo_mode_write_protect( |
@@ -1837,7 +1837,7 @@ static int lio_tpg_check_demo_mode_write_protect( | |||
1837 | { | 1837 | { |
1838 | struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr; | 1838 | struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr; |
1839 | 1839 | ||
1840 | return ISCSI_TPG_ATTRIB(tpg)->demo_mode_write_protect; | 1840 | return tpg->tpg_attrib.demo_mode_write_protect; |
1841 | } | 1841 | } |
1842 | 1842 | ||
1843 | static int lio_tpg_check_prod_mode_write_protect( | 1843 | static int lio_tpg_check_prod_mode_write_protect( |
@@ -1845,7 +1845,7 @@ static int lio_tpg_check_prod_mode_write_protect( | |||
1845 | { | 1845 | { |
1846 | struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr; | 1846 | struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr; |
1847 | 1847 | ||
1848 | return ISCSI_TPG_ATTRIB(tpg)->prod_mode_write_protect; | 1848 | return tpg->tpg_attrib.prod_mode_write_protect; |
1849 | } | 1849 | } |
1850 | 1850 | ||
1851 | static void lio_tpg_release_fabric_acl( | 1851 | static void lio_tpg_release_fabric_acl( |
@@ -1909,7 +1909,7 @@ static void lio_set_default_node_attributes(struct se_node_acl *se_acl) | |||
1909 | struct iscsi_node_acl *acl = container_of(se_acl, struct iscsi_node_acl, | 1909 | struct iscsi_node_acl *acl = container_of(se_acl, struct iscsi_node_acl, |
1910 | se_node_acl); | 1910 | se_node_acl); |
1911 | 1911 | ||
1912 | ISCSI_NODE_ATTRIB(acl)->nacl = acl; | 1912 | acl->node_attrib.nacl = acl; |
1913 | iscsit_set_default_node_attribues(acl); | 1913 | iscsit_set_default_node_attribues(acl); |
1914 | } | 1914 | } |
1915 | 1915 | ||
diff --git a/drivers/target/iscsi/iscsi_target_core.h b/drivers/target/iscsi/iscsi_target_core.h index 9a5721b8ff96..1d14f77aec2e 100644 --- a/drivers/target/iscsi/iscsi_target_core.h +++ b/drivers/target/iscsi/iscsi_target_core.h | |||
@@ -755,11 +755,6 @@ struct iscsi_node_acl { | |||
755 | struct se_node_acl se_node_acl; | 755 | struct se_node_acl se_node_acl; |
756 | }; | 756 | }; |
757 | 757 | ||
758 | #define NODE_STAT_GRPS(nacl) (&(nacl)->node_stat_grps) | ||
759 | |||
760 | #define ISCSI_NODE_ATTRIB(t) (&(t)->node_attrib) | ||
761 | #define ISCSI_NODE_AUTH(t) (&(t)->node_auth) | ||
762 | |||
763 | struct iscsi_tpg_attrib { | 758 | struct iscsi_tpg_attrib { |
764 | u32 authentication; | 759 | u32 authentication; |
765 | u32 login_timeout; | 760 | u32 login_timeout; |
@@ -838,8 +833,6 @@ struct iscsi_portal_group { | |||
838 | #define ISCSI_TPG_C(c) ((struct iscsi_portal_group *)(c)->tpg) | 833 | #define ISCSI_TPG_C(c) ((struct iscsi_portal_group *)(c)->tpg) |
839 | #define ISCSI_TPG_LUN(c, l) ((iscsi_tpg_list_t *)(c)->tpg->tpg_lun_list_t[l]) | 834 | #define ISCSI_TPG_LUN(c, l) ((iscsi_tpg_list_t *)(c)->tpg->tpg_lun_list_t[l]) |
840 | #define ISCSI_TPG_S(s) ((struct iscsi_portal_group *)(s)->tpg) | 835 | #define ISCSI_TPG_S(s) ((struct iscsi_portal_group *)(s)->tpg) |
841 | #define ISCSI_TPG_ATTRIB(t) (&(t)->tpg_attrib) | ||
842 | #define SE_TPG(tpg) (&(tpg)->tpg_se_tpg) | ||
843 | 836 | ||
844 | struct iscsi_wwn_stat_grps { | 837 | struct iscsi_wwn_stat_grps { |
845 | struct config_group iscsi_stat_group; | 838 | struct config_group iscsi_stat_group; |
@@ -871,8 +864,6 @@ struct iscsi_tiqn { | |||
871 | struct iscsi_logout_stats logout_stats; | 864 | struct iscsi_logout_stats logout_stats; |
872 | } ____cacheline_aligned; | 865 | } ____cacheline_aligned; |
873 | 866 | ||
874 | #define WWN_STAT_GRPS(tiqn) (&(tiqn)->tiqn_stat_grps) | ||
875 | |||
876 | struct iscsit_global { | 867 | struct iscsit_global { |
877 | /* In core shutdown */ | 868 | /* In core shutdown */ |
878 | u32 in_shutdown; | 869 | u32 in_shutdown; |
diff --git a/drivers/target/iscsi/iscsi_target_nego.c b/drivers/target/iscsi/iscsi_target_nego.c index 14d1aed5af1d..973a27f68a68 100644 --- a/drivers/target/iscsi/iscsi_target_nego.c +++ b/drivers/target/iscsi/iscsi_target_nego.c | |||
@@ -140,7 +140,7 @@ static u32 iscsi_handle_authentication( | |||
140 | iscsi_nacl = container_of(se_nacl, struct iscsi_node_acl, | 140 | iscsi_nacl = container_of(se_nacl, struct iscsi_node_acl, |
141 | se_node_acl); | 141 | se_node_acl); |
142 | 142 | ||
143 | auth = ISCSI_NODE_AUTH(iscsi_nacl); | 143 | auth = &iscsi_nacl->node_auth; |
144 | } | 144 | } |
145 | } else { | 145 | } else { |
146 | /* | 146 | /* |
@@ -789,7 +789,7 @@ static int iscsi_target_handle_csg_zero( | |||
789 | return -1; | 789 | return -1; |
790 | 790 | ||
791 | if (!iscsi_check_negotiated_keys(conn->param_list)) { | 791 | if (!iscsi_check_negotiated_keys(conn->param_list)) { |
792 | if (ISCSI_TPG_ATTRIB(ISCSI_TPG_C(conn))->authentication && | 792 | if (ISCSI_TPG_C(conn)->tpg_attrib.authentication && |
793 | !strncmp(param->value, NONE, 4)) { | 793 | !strncmp(param->value, NONE, 4)) { |
794 | pr_err("Initiator sent AuthMethod=None but" | 794 | pr_err("Initiator sent AuthMethod=None but" |
795 | " Target is enforcing iSCSI Authentication," | 795 | " Target is enforcing iSCSI Authentication," |
@@ -799,7 +799,7 @@ static int iscsi_target_handle_csg_zero( | |||
799 | return -1; | 799 | return -1; |
800 | } | 800 | } |
801 | 801 | ||
802 | if (ISCSI_TPG_ATTRIB(ISCSI_TPG_C(conn))->authentication && | 802 | if (ISCSI_TPG_C(conn)->tpg_attrib.authentication && |
803 | !login->auth_complete) | 803 | !login->auth_complete) |
804 | return 0; | 804 | return 0; |
805 | 805 | ||
@@ -862,7 +862,7 @@ static int iscsi_target_handle_csg_one(struct iscsi_conn *conn, struct iscsi_log | |||
862 | } | 862 | } |
863 | 863 | ||
864 | if (!login->auth_complete && | 864 | if (!login->auth_complete && |
865 | ISCSI_TPG_ATTRIB(ISCSI_TPG_C(conn))->authentication) { | 865 | ISCSI_TPG_C(conn)->tpg_attrib.authentication) { |
866 | pr_err("Initiator is requesting CSG: 1, has not been" | 866 | pr_err("Initiator is requesting CSG: 1, has not been" |
867 | " successfully authenticated, and the Target is" | 867 | " successfully authenticated, and the Target is" |
868 | " enforcing iSCSI Authentication, login failed.\n"); | 868 | " enforcing iSCSI Authentication, login failed.\n"); |
diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c index 4faeb47fa5e1..1ef5df03ff5c 100644 --- a/drivers/target/iscsi/iscsi_target_tpg.c +++ b/drivers/target/iscsi/iscsi_target_tpg.c | |||
@@ -237,7 +237,7 @@ int iscsit_tpg_add_portal_group(struct iscsi_tiqn *tiqn, struct iscsi_portal_gro | |||
237 | if (iscsi_create_default_params(&tpg->param_list) < 0) | 237 | if (iscsi_create_default_params(&tpg->param_list) < 0) |
238 | goto err_out; | 238 | goto err_out; |
239 | 239 | ||
240 | ISCSI_TPG_ATTRIB(tpg)->tpg = tpg; | 240 | tpg->tpg_attrib.tpg = tpg; |
241 | 241 | ||
242 | spin_lock(&tpg->tpg_state_lock); | 242 | spin_lock(&tpg->tpg_state_lock); |
243 | tpg->tpg_state = TPG_STATE_INACTIVE; | 243 | tpg->tpg_state = TPG_STATE_INACTIVE; |
@@ -330,7 +330,7 @@ int iscsit_tpg_enable_portal_group(struct iscsi_portal_group *tpg) | |||
330 | return -EINVAL; | 330 | return -EINVAL; |
331 | } | 331 | } |
332 | 332 | ||
333 | if (ISCSI_TPG_ATTRIB(tpg)->authentication) { | 333 | if (tpg->tpg_attrib.authentication) { |
334 | if (!strcmp(param->value, NONE)) { | 334 | if (!strcmp(param->value, NONE)) { |
335 | ret = iscsi_update_param_value(param, CHAP); | 335 | ret = iscsi_update_param_value(param, CHAP); |
336 | if (ret) | 336 | if (ret) |