Commit 2b6eb609 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Nicholas Bellinger

target/iscsi: stop using se_tpg_fabric_ptr

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
parent 18213afb
......@@ -1789,69 +1789,58 @@ static void lio_aborted_task(struct se_cmd *se_cmd)
cmd->conn->conn_transport->iscsit_aborted_task(cmd->conn, cmd);
}
static char *lio_tpg_get_endpoint_wwn(struct se_portal_group *se_tpg)
static inline struct iscsi_portal_group *iscsi_tpg(struct se_portal_group *se_tpg)
{
struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
return container_of(se_tpg, struct iscsi_portal_group, tpg_se_tpg);
}
return &tpg->tpg_tiqn->tiqn[0];
static char *lio_tpg_get_endpoint_wwn(struct se_portal_group *se_tpg)
{
return iscsi_tpg(se_tpg)->tpg_tiqn->tiqn;
}
static u16 lio_tpg_get_tag(struct se_portal_group *se_tpg)
{
struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
return tpg->tpgt;
return iscsi_tpg(se_tpg)->tpgt;
}
static u32 lio_tpg_get_default_depth(struct se_portal_group *se_tpg)
{
struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
return tpg->tpg_attrib.default_cmdsn_depth;
return iscsi_tpg(se_tpg)->tpg_attrib.default_cmdsn_depth;
}
static int lio_tpg_check_demo_mode(struct se_portal_group *se_tpg)
{
struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
return tpg->tpg_attrib.generate_node_acls;
return iscsi_tpg(se_tpg)->tpg_attrib.generate_node_acls;
}
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;
return tpg->tpg_attrib.cache_dynamic_acls;
return iscsi_tpg(se_tpg)->tpg_attrib.cache_dynamic_acls;
}
static int lio_tpg_check_demo_mode_write_protect(
struct se_portal_group *se_tpg)
{
struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
return tpg->tpg_attrib.demo_mode_write_protect;
return iscsi_tpg(se_tpg)->tpg_attrib.demo_mode_write_protect;
}
static int lio_tpg_check_prod_mode_write_protect(
struct se_portal_group *se_tpg)
{
struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
return tpg->tpg_attrib.prod_mode_write_protect;
return iscsi_tpg(se_tpg)->tpg_attrib.prod_mode_write_protect;
}
static int lio_tpg_check_prot_fabric_only(
struct se_portal_group *se_tpg)
{
struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
/*
* Only report fabric_prot_type if t10_pi has also been enabled
* for incoming ib_isert sessions.
*/
if (!tpg->tpg_attrib.t10_pi)
if (!iscsi_tpg(se_tpg)->tpg_attrib.t10_pi)
return 0;
return tpg->tpg_attrib.fabric_prot_type;
return iscsi_tpg(se_tpg)->tpg_attrib.fabric_prot_type;
}
/*
......@@ -1896,9 +1885,7 @@ static void lio_tpg_close_session(struct se_session *se_sess)
static u32 lio_tpg_get_inst_index(struct se_portal_group *se_tpg)
{
struct iscsi_portal_group *tpg = se_tpg->se_tpg_fabric_ptr;
return tpg->tpg_tiqn->tiqn_index;
return iscsi_tpg(se_tpg)->tpg_tiqn->tiqn_index;
}
static void lio_set_default_node_attributes(struct se_node_acl *se_acl)
......
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