Skip to content

Commit 27f722c

Browse files
bvanasschemartinkpetersen
authored andcommitted
scsi: target: Remove tpg_list and se_portal_group.se_tpg_node
Maintaining tpg_list without ever iterating over it is not useful. Hence remove tpg_list. This patch does not change the behavior of the SCSI target code. Cc: Mike Christie <mchristie@redhat.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Hannes Reinecke <hare@suse.de> Cc: Nicholas Bellinger <nab@linux-iscsi.org> Link: https://lore.kernel.org/r/20190930232224.58980-1-bvanassche@acm.org Signed-off-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Mike Christie <mchristi@redhat.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 7cd4cb9 commit 27f722c

3 files changed

Lines changed: 0 additions & 14 deletions

File tree

‎drivers/target/target_core_tpg.c‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232

3333
extern struct se_device *g_lun0_dev;
3434

35-
static DEFINE_SPINLOCK(tpg_lock);
36-
static LIST_HEAD(tpg_list);
37-
3835
/* __core_tpg_get_initiator_node_acl():
3936
*
4037
* mutex_lock(&tpg->acl_node_mutex); must be held when calling
@@ -475,7 +472,6 @@ int core_tpg_register(
475472
se_tpg->se_tpg_wwn = se_wwn;
476473
atomic_set(&se_tpg->tpg_pr_ref_count, 0);
477474
INIT_LIST_HEAD(&se_tpg->acl_node_list);
478-
INIT_LIST_HEAD(&se_tpg->se_tpg_node);
479475
INIT_LIST_HEAD(&se_tpg->tpg_sess_list);
480476
spin_lock_init(&se_tpg->session_lock);
481477
mutex_init(&se_tpg->tpg_lun_mutex);
@@ -494,10 +490,6 @@ int core_tpg_register(
494490
}
495491
}
496492

497-
spin_lock_bh(&tpg_lock);
498-
list_add_tail(&se_tpg->se_tpg_node, &tpg_list);
499-
spin_unlock_bh(&tpg_lock);
500-
501493
pr_debug("TARGET_CORE[%s]: Allocated portal_group for endpoint: %s, "
502494
"Proto: %d, Portal Tag: %u\n", se_tpg->se_tpg_tfo->fabric_name,
503495
se_tpg->se_tpg_tfo->tpg_get_wwn(se_tpg) ?
@@ -519,10 +511,6 @@ int core_tpg_deregister(struct se_portal_group *se_tpg)
519511
tfo->tpg_get_wwn(se_tpg) ? tfo->tpg_get_wwn(se_tpg) : NULL,
520512
se_tpg->proto_id, tfo->tpg_get_tag(se_tpg));
521513

522-
spin_lock_bh(&tpg_lock);
523-
list_del(&se_tpg->se_tpg_node);
524-
spin_unlock_bh(&tpg_lock);
525-
526514
while (atomic_read(&se_tpg->tpg_pr_ref_count) != 0)
527515
cpu_relax();
528516

‎drivers/target/target_core_xcopy.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,6 @@ int target_xcopy_setup_pt(void)
467467
}
468468

469469
memset(&xcopy_pt_tpg, 0, sizeof(struct se_portal_group));
470-
INIT_LIST_HEAD(&xcopy_pt_tpg.se_tpg_node);
471470
INIT_LIST_HEAD(&xcopy_pt_tpg.acl_node_list);
472471
INIT_LIST_HEAD(&xcopy_pt_tpg.tpg_sess_list);
473472

‎include/target/target_core_base.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,6 @@ struct se_portal_group {
876876
/* Spinlock for adding/removing sessions */
877877
spinlock_t session_lock;
878878
struct mutex tpg_lun_mutex;
879-
struct list_head se_tpg_node;
880879
/* linked list for initiator ACL list */
881880
struct list_head acl_node_list;
882881
struct hlist_head tpg_lun_hlist;

0 commit comments

Comments
 (0)