Commit b7eec2cd authored by Andy Grover's avatar Andy Grover Committed by Nicholas Bellinger

target/iscsi: Remove iscsi dereferencing macros

These are all straightforward.
Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAndy Grover <agrover@redhat.com>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent d80e224d
...@@ -372,7 +372,7 @@ static ssize_t iscsi_nacl_attrib_show_##name( \ ...@@ -372,7 +372,7 @@ static ssize_t iscsi_nacl_attrib_show_##name( \
struct iscsi_node_acl *nacl = container_of(se_nacl, struct iscsi_node_acl, \ struct iscsi_node_acl *nacl = container_of(se_nacl, struct iscsi_node_acl, \
se_node_acl); \ se_node_acl); \
\ \
return sprintf(page, "%u\n", ISCSI_NODE_ATTRIB(nacl)->name); \ return sprintf(page, "%u\n", nacl->node_attrib.name); \
} \ } \
\ \
static ssize_t iscsi_nacl_attrib_store_##name( \ static ssize_t iscsi_nacl_attrib_store_##name( \
...@@ -897,7 +897,7 @@ static struct se_node_acl *lio_target_make_nodeacl( ...@@ -897,7 +897,7 @@ static struct se_node_acl *lio_target_make_nodeacl(
if (!se_nacl_new) if (!se_nacl_new)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
cmdsn_depth = ISCSI_TPG_ATTRIB(tpg)->default_cmdsn_depth; cmdsn_depth = tpg->tpg_attrib.default_cmdsn_depth;
/* /*
* se_nacl_new may be released by core_tpg_add_initiator_node_acl() * se_nacl_new may be released by core_tpg_add_initiator_node_acl()
* when converting a NdoeACL from demo mode -> explict * when converting a NdoeACL from demo mode -> explict
...@@ -920,9 +920,9 @@ static struct se_node_acl *lio_target_make_nodeacl( ...@@ -920,9 +920,9 @@ static struct se_node_acl *lio_target_make_nodeacl(
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
stats_cg->default_groups[0] = &NODE_STAT_GRPS(acl)->iscsi_sess_stats_group; stats_cg->default_groups[0] = &acl->node_stat_grps.iscsi_sess_stats_group;
stats_cg->default_groups[1] = NULL; stats_cg->default_groups[1] = NULL;
config_group_init_type_name(&NODE_STAT_GRPS(acl)->iscsi_sess_stats_group, config_group_init_type_name(&acl->node_stat_grps.iscsi_sess_stats_group,
"iscsi_sess_stats", &iscsi_stat_sess_cit); "iscsi_sess_stats", &iscsi_stat_sess_cit);
return se_nacl; return se_nacl;
...@@ -967,7 +967,7 @@ static ssize_t iscsi_tpg_attrib_show_##name( \ ...@@ -967,7 +967,7 @@ static ssize_t iscsi_tpg_attrib_show_##name( \
if (iscsit_get_tpg(tpg) < 0) \ if (iscsit_get_tpg(tpg) < 0) \
return -EINVAL; \ return -EINVAL; \
\ \
rb = sprintf(page, "%u\n", ISCSI_TPG_ATTRIB(tpg)->name); \ rb = sprintf(page, "%u\n", tpg->tpg_attrib.name); \
iscsit_put_tpg(tpg); \ iscsit_put_tpg(tpg); \
return rb; \ return rb; \
} \ } \
...@@ -1514,21 +1514,21 @@ static struct se_wwn *lio_target_call_coreaddtiqn( ...@@ -1514,21 +1514,21 @@ static struct se_wwn *lio_target_call_coreaddtiqn(
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
} }
stats_cg->default_groups[0] = &WWN_STAT_GRPS(tiqn)->iscsi_instance_group; stats_cg->default_groups[0] = &tiqn->tiqn_stat_grps.iscsi_instance_group;
stats_cg->default_groups[1] = &WWN_STAT_GRPS(tiqn)->iscsi_sess_err_group; stats_cg->default_groups[1] = &tiqn->tiqn_stat_grps.iscsi_sess_err_group;
stats_cg->default_groups[2] = &WWN_STAT_GRPS(tiqn)->iscsi_tgt_attr_group; stats_cg->default_groups[2] = &tiqn->tiqn_stat_grps.iscsi_tgt_attr_group;
stats_cg->default_groups[3] = &WWN_STAT_GRPS(tiqn)->iscsi_login_stats_group; stats_cg->default_groups[3] = &tiqn->tiqn_stat_grps.iscsi_login_stats_group;
stats_cg->default_groups[4] = &WWN_STAT_GRPS(tiqn)->iscsi_logout_stats_group; stats_cg->default_groups[4] = &tiqn->tiqn_stat_grps.iscsi_logout_stats_group;
stats_cg->default_groups[5] = NULL; stats_cg->default_groups[5] = NULL;
config_group_init_type_name(&WWN_STAT_GRPS(tiqn)->iscsi_instance_group, config_group_init_type_name(&tiqn->tiqn_stat_grps.iscsi_instance_group,
"iscsi_instance", &iscsi_stat_instance_cit); "iscsi_instance", &iscsi_stat_instance_cit);
config_group_init_type_name(&WWN_STAT_GRPS(tiqn)->iscsi_sess_err_group, config_group_init_type_name(&tiqn->tiqn_stat_grps.iscsi_sess_err_group,
"iscsi_sess_err", &iscsi_stat_sess_err_cit); "iscsi_sess_err", &iscsi_stat_sess_err_cit);
config_group_init_type_name(&WWN_STAT_GRPS(tiqn)->iscsi_tgt_attr_group, config_group_init_type_name(&tiqn->tiqn_stat_grps.iscsi_tgt_attr_group,
"iscsi_tgt_attr", &iscsi_stat_tgt_attr_cit); "iscsi_tgt_attr", &iscsi_stat_tgt_attr_cit);
config_group_init_type_name(&WWN_STAT_GRPS(tiqn)->iscsi_login_stats_group, config_group_init_type_name(&tiqn->tiqn_stat_grps.iscsi_login_stats_group,
"iscsi_login_stats", &iscsi_stat_login_cit); "iscsi_login_stats", &iscsi_stat_login_cit);
config_group_init_type_name(&WWN_STAT_GRPS(tiqn)->iscsi_logout_stats_group, config_group_init_type_name(&tiqn->tiqn_stat_grps.iscsi_logout_stats_group,
"iscsi_logout_stats", &iscsi_stat_logout_cit); "iscsi_logout_stats", &iscsi_stat_logout_cit);
pr_debug("LIO_Target_ConfigFS: REGISTER -> %s\n", tiqn->tiqn); 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,21 +1815,21 @@ static u32 lio_tpg_get_default_depth(struct se_portal_group *se_tpg)
{ {
struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr; struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
return ISCSI_TPG_ATTRIB(tpg)->default_cmdsn_depth; return tpg->tpg_attrib.default_cmdsn_depth;
} }
static int lio_tpg_check_demo_mode(struct se_portal_group *se_tpg) static int lio_tpg_check_demo_mode(struct se_portal_group *se_tpg)
{ {
struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr; struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
return ISCSI_TPG_ATTRIB(tpg)->generate_node_acls; return tpg->tpg_attrib.generate_node_acls;
} }
static int lio_tpg_check_demo_mode_cache(struct se_portal_group *se_tpg) static int lio_tpg_check_demo_mode_cache(struct se_portal_group *se_tpg)
{ {
struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr; struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
return ISCSI_TPG_ATTRIB(tpg)->cache_dynamic_acls; return tpg->tpg_attrib.cache_dynamic_acls;
} }
static int lio_tpg_check_demo_mode_write_protect( static int lio_tpg_check_demo_mode_write_protect(
...@@ -1837,7 +1837,7 @@ static int lio_tpg_check_demo_mode_write_protect( ...@@ -1837,7 +1837,7 @@ static int lio_tpg_check_demo_mode_write_protect(
{ {
struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr; struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
return ISCSI_TPG_ATTRIB(tpg)->demo_mode_write_protect; return tpg->tpg_attrib.demo_mode_write_protect;
} }
static int lio_tpg_check_prod_mode_write_protect( static int lio_tpg_check_prod_mode_write_protect(
...@@ -1845,7 +1845,7 @@ static int lio_tpg_check_prod_mode_write_protect( ...@@ -1845,7 +1845,7 @@ static int lio_tpg_check_prod_mode_write_protect(
{ {
struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr; struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
return ISCSI_TPG_ATTRIB(tpg)->prod_mode_write_protect; return tpg->tpg_attrib.prod_mode_write_protect;
} }
static void lio_tpg_release_fabric_acl( 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,7 +1909,7 @@ static void lio_set_default_node_attributes(struct se_node_acl *se_acl)
struct iscsi_node_acl *acl = container_of(se_acl, struct iscsi_node_acl, struct iscsi_node_acl *acl = container_of(se_acl, struct iscsi_node_acl,
se_node_acl); se_node_acl);
ISCSI_NODE_ATTRIB(acl)->nacl = acl; acl->node_attrib.nacl = acl;
iscsit_set_default_node_attribues(acl); iscsit_set_default_node_attribues(acl);
} }
......
...@@ -755,11 +755,6 @@ struct iscsi_node_acl { ...@@ -755,11 +755,6 @@ struct iscsi_node_acl {
struct se_node_acl se_node_acl; struct se_node_acl se_node_acl;
}; };
#define NODE_STAT_GRPS(nacl) (&(nacl)->node_stat_grps)
#define ISCSI_NODE_ATTRIB(t) (&(t)->node_attrib)
#define ISCSI_NODE_AUTH(t) (&(t)->node_auth)
struct iscsi_tpg_attrib { struct iscsi_tpg_attrib {
u32 authentication; u32 authentication;
u32 login_timeout; u32 login_timeout;
...@@ -838,8 +833,6 @@ struct iscsi_portal_group { ...@@ -838,8 +833,6 @@ struct iscsi_portal_group {
#define ISCSI_TPG_C(c) ((struct iscsi_portal_group *)(c)->tpg) #define ISCSI_TPG_C(c) ((struct iscsi_portal_group *)(c)->tpg)
#define ISCSI_TPG_LUN(c, l) ((iscsi_tpg_list_t *)(c)->tpg->tpg_lun_list_t[l]) #define ISCSI_TPG_LUN(c, l) ((iscsi_tpg_list_t *)(c)->tpg->tpg_lun_list_t[l])
#define ISCSI_TPG_S(s) ((struct iscsi_portal_group *)(s)->tpg) #define ISCSI_TPG_S(s) ((struct iscsi_portal_group *)(s)->tpg)
#define ISCSI_TPG_ATTRIB(t) (&(t)->tpg_attrib)
#define SE_TPG(tpg) (&(tpg)->tpg_se_tpg)
struct iscsi_wwn_stat_grps { struct iscsi_wwn_stat_grps {
struct config_group iscsi_stat_group; struct config_group iscsi_stat_group;
...@@ -871,8 +864,6 @@ struct iscsi_tiqn { ...@@ -871,8 +864,6 @@ struct iscsi_tiqn {
struct iscsi_logout_stats logout_stats; struct iscsi_logout_stats logout_stats;
} ____cacheline_aligned; } ____cacheline_aligned;
#define WWN_STAT_GRPS(tiqn) (&(tiqn)->tiqn_stat_grps)
struct iscsit_global { struct iscsit_global {
/* In core shutdown */ /* In core shutdown */
u32 in_shutdown; u32 in_shutdown;
......
...@@ -140,7 +140,7 @@ static u32 iscsi_handle_authentication( ...@@ -140,7 +140,7 @@ static u32 iscsi_handle_authentication(
iscsi_nacl = container_of(se_nacl, struct iscsi_node_acl, iscsi_nacl = container_of(se_nacl, struct iscsi_node_acl,
se_node_acl); se_node_acl);
auth = ISCSI_NODE_AUTH(iscsi_nacl); auth = &iscsi_nacl->node_auth;
} }
} else { } else {
/* /*
...@@ -789,7 +789,7 @@ static int iscsi_target_handle_csg_zero( ...@@ -789,7 +789,7 @@ static int iscsi_target_handle_csg_zero(
return -1; return -1;
if (!iscsi_check_negotiated_keys(conn->param_list)) { if (!iscsi_check_negotiated_keys(conn->param_list)) {
if (ISCSI_TPG_ATTRIB(ISCSI_TPG_C(conn))->authentication && if (ISCSI_TPG_C(conn)->tpg_attrib.authentication &&
!strncmp(param->value, NONE, 4)) { !strncmp(param->value, NONE, 4)) {
pr_err("Initiator sent AuthMethod=None but" pr_err("Initiator sent AuthMethod=None but"
" Target is enforcing iSCSI Authentication," " Target is enforcing iSCSI Authentication,"
...@@ -799,7 +799,7 @@ static int iscsi_target_handle_csg_zero( ...@@ -799,7 +799,7 @@ static int iscsi_target_handle_csg_zero(
return -1; return -1;
} }
if (ISCSI_TPG_ATTRIB(ISCSI_TPG_C(conn))->authentication && if (ISCSI_TPG_C(conn)->tpg_attrib.authentication &&
!login->auth_complete) !login->auth_complete)
return 0; return 0;
...@@ -862,7 +862,7 @@ static int iscsi_target_handle_csg_one(struct iscsi_conn *conn, struct iscsi_log ...@@ -862,7 +862,7 @@ static int iscsi_target_handle_csg_one(struct iscsi_conn *conn, struct iscsi_log
} }
if (!login->auth_complete && if (!login->auth_complete &&
ISCSI_TPG_ATTRIB(ISCSI_TPG_C(conn))->authentication) { ISCSI_TPG_C(conn)->tpg_attrib.authentication) {
pr_err("Initiator is requesting CSG: 1, has not been" pr_err("Initiator is requesting CSG: 1, has not been"
" successfully authenticated, and the Target is" " successfully authenticated, and the Target is"
" enforcing iSCSI Authentication, login failed.\n"); " enforcing iSCSI Authentication, login failed.\n");
......
...@@ -237,7 +237,7 @@ int iscsit_tpg_add_portal_group(struct iscsi_tiqn *tiqn, struct iscsi_portal_gro ...@@ -237,7 +237,7 @@ int iscsit_tpg_add_portal_group(struct iscsi_tiqn *tiqn, struct iscsi_portal_gro
if (iscsi_create_default_params(&tpg->param_list) < 0) if (iscsi_create_default_params(&tpg->param_list) < 0)
goto err_out; goto err_out;
ISCSI_TPG_ATTRIB(tpg)->tpg = tpg; tpg->tpg_attrib.tpg = tpg;
spin_lock(&tpg->tpg_state_lock); spin_lock(&tpg->tpg_state_lock);
tpg->tpg_state = TPG_STATE_INACTIVE; tpg->tpg_state = TPG_STATE_INACTIVE;
...@@ -330,7 +330,7 @@ int iscsit_tpg_enable_portal_group(struct iscsi_portal_group *tpg) ...@@ -330,7 +330,7 @@ int iscsit_tpg_enable_portal_group(struct iscsi_portal_group *tpg)
return -EINVAL; return -EINVAL;
} }
if (ISCSI_TPG_ATTRIB(tpg)->authentication) { if (tpg->tpg_attrib.authentication) {
if (!strcmp(param->value, NONE)) { if (!strcmp(param->value, NONE)) {
ret = iscsi_update_param_value(param, CHAP); ret = iscsi_update_param_value(param, CHAP);
if (ret) if (ret)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment