summaryrefslogtreecommitdiff
path: root/drivers/target
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2015-04-13 20:51:13 +0300
committerNicholas Bellinger <nab@linux-iscsi.org>2015-05-31 08:41:50 +0300
commite1750d20e69477c0d7b26d6e0ba24c3c9ec47530 (patch)
treec54f6d625cb55009c692b3d2841bd35d7c724f60 /drivers/target
parent55570113a955091af5fafa94cd50914d994e09ae (diff)
downloadlinux-e1750d20e69477c0d7b26d6e0ba24c3c9ec47530.tar.xz
target: make the tpg_get_default_depth method optional
All fabric drivers except for iSCSI always return 1, so implement that as default behavior. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/loopback/tcm_loop.c6
-rw-r--r--drivers/target/sbp/sbp_target.c6
-rw-r--r--drivers/target/target_core_configfs.c4
-rw-r--r--drivers/target/target_core_tpg.c5
-rw-r--r--drivers/target/tcm_fc/tfc_conf.c6
5 files changed, 4 insertions, 23 deletions
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index e11bcf3e0889..12b85b03e9ae 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -566,11 +566,6 @@ static u16 tcm_loop_get_tag(struct se_portal_group *se_tpg)
return tl_tpg->tl_tpgt;
}
-static u32 tcm_loop_get_default_depth(struct se_portal_group *se_tpg)
-{
- return 1;
-}
-
static u32 tcm_loop_get_pr_transport_id(
struct se_portal_group *se_tpg,
struct se_node_acl *se_nacl,
@@ -1378,7 +1373,6 @@ static const struct target_core_fabric_ops loop_ops = {
.get_fabric_proto_ident = tcm_loop_get_fabric_proto_ident,
.tpg_get_wwn = tcm_loop_get_endpoint_wwn,
.tpg_get_tag = tcm_loop_get_tag,
- .tpg_get_default_depth = tcm_loop_get_default_depth,
.tpg_get_pr_transport_id = tcm_loop_get_pr_transport_id,
.tpg_get_pr_transport_id_len = tcm_loop_get_pr_transport_id_len,
.tpg_parse_pr_out_transport_id = tcm_loop_parse_pr_out_transport_id,
diff --git a/drivers/target/sbp/sbp_target.c b/drivers/target/sbp/sbp_target.c
index 61da83be8966..0d70d4f58e43 100644
--- a/drivers/target/sbp/sbp_target.c
+++ b/drivers/target/sbp/sbp_target.c
@@ -1707,11 +1707,6 @@ static u16 sbp_get_tag(struct se_portal_group *se_tpg)
return tpg->tport_tpgt;
}
-static u32 sbp_get_default_depth(struct se_portal_group *se_tpg)
-{
- return 1;
-}
-
static struct se_node_acl *sbp_alloc_fabric_acl(struct se_portal_group *se_tpg)
{
return kzalloc(sizeof(struct se_node_acl), GFP_KERNEL);
@@ -2490,7 +2485,6 @@ static const struct target_core_fabric_ops sbp_ops = {
.get_fabric_proto_ident = sbp_get_fabric_proto_ident,
.tpg_get_wwn = sbp_get_fabric_wwn,
.tpg_get_tag = sbp_get_tag,
- .tpg_get_default_depth = sbp_get_default_depth,
.tpg_get_pr_transport_id = sbp_get_pr_transport_id,
.tpg_get_pr_transport_id_len = sbp_get_pr_transport_id_len,
.tpg_parse_pr_out_transport_id = sbp_parse_pr_out_transport_id,
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
index e7b0430a0575..c87ca0c50545 100644
--- a/drivers/target/target_core_configfs.c
+++ b/drivers/target/target_core_configfs.c
@@ -330,10 +330,6 @@ static int target_fabric_tf_ops_check(const struct target_core_fabric_ops *tfo)
pr_err("Missing tfo->tpg_get_tag()\n");
return -EINVAL;
}
- if (!tfo->tpg_get_default_depth) {
- pr_err("Missing tfo->tpg_get_default_depth()\n");
- return -EINVAL;
- }
if (!tfo->tpg_get_pr_transport_id) {
pr_err("Missing tfo->tpg_get_pr_transport_id()\n");
return -EINVAL;
diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c
index 47f064415bf6..5a9deb2b24af 100644
--- a/drivers/target/target_core_tpg.c
+++ b/drivers/target/target_core_tpg.c
@@ -282,7 +282,10 @@ struct se_node_acl *core_tpg_check_initiator_node_acl(
spin_lock_init(&acl->device_list_lock);
spin_lock_init(&acl->nacl_sess_lock);
atomic_set(&acl->acl_pr_ref_count, 0);
- acl->queue_depth = tpg->se_tpg_tfo->tpg_get_default_depth(tpg);
+ if (tpg->se_tpg_tfo->tpg_get_default_depth)
+ acl->queue_depth = tpg->se_tpg_tfo->tpg_get_default_depth(tpg);
+ else
+ acl->queue_depth = 1;
snprintf(acl->initiatorname, TRANSPORT_IQN_LEN, "%s", initiatorname);
acl->se_tpg = tpg;
acl->acl_index = scsi_get_new_index(SCSI_AUTH_INTR_INDEX);
diff --git a/drivers/target/tcm_fc/tfc_conf.c b/drivers/target/tcm_fc/tfc_conf.c
index 65dce1345966..46b4387460e5 100644
--- a/drivers/target/tcm_fc/tfc_conf.c
+++ b/drivers/target/tcm_fc/tfc_conf.c
@@ -486,11 +486,6 @@ static u16 ft_get_tag(struct se_portal_group *se_tpg)
return tpg->index;
}
-static u32 ft_get_default_depth(struct se_portal_group *se_tpg)
-{
- return 1;
-}
-
static int ft_check_false(struct se_portal_group *se_tpg)
{
return 0;
@@ -514,7 +509,6 @@ static const struct target_core_fabric_ops ft_fabric_ops = {
.get_fabric_proto_ident = fc_get_fabric_proto_ident,
.tpg_get_wwn = ft_get_fabric_wwn,
.tpg_get_tag = ft_get_tag,
- .tpg_get_default_depth = ft_get_default_depth,
.tpg_get_pr_transport_id = fc_get_pr_transport_id,
.tpg_get_pr_transport_id_len = fc_get_pr_transport_id_len,
.tpg_parse_pr_out_transport_id = fc_parse_pr_out_transport_id,