diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-05-21 22:05:19 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2015-06-01 03:25:15 -0400 |
commit | df9766ca9da5d9c1f2bb4eea9c9f16a2e7e8e1a5 (patch) | |
tree | 975b36ac839245995493ce50c11bda0c0c4651ea /drivers/target/target_core_tpg.c | |
parent | 84786546b6ff8d50c3e4c1ea877a872cf55d485a (diff) |
target: Only reset specific dynamic entries during lun_group creation
This patch changes core_tpg_add_node_to_devs() to avoid unnecessarly
resetting every se_dev_entry in se_node_acl->tpg_lun_hlist when the
operation is driven by an explicit configfs se_lun->lun_group creation
via core_dev_add_lun() to only update a single se_lun.
Otherwise for the second core_tpg_check_initiator_node_acl() case, go
ahead and continue to scan the full set of currently active se_lun in
se_portal_group->tpg_lun_hlist.
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Sagi Grimberg <sagig@mellanox.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_tpg.c')
-rw-r--r-- | drivers/target/target_core_tpg.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index 73c25bda5a25..f66c208386f8 100644 --- a/drivers/target/target_core_tpg.c +++ b/drivers/target/target_core_tpg.c | |||
@@ -89,7 +89,8 @@ EXPORT_SYMBOL(core_tpg_get_initiator_node_acl); | |||
89 | */ | 89 | */ |
90 | void core_tpg_add_node_to_devs( | 90 | void core_tpg_add_node_to_devs( |
91 | struct se_node_acl *acl, | 91 | struct se_node_acl *acl, |
92 | struct se_portal_group *tpg) | 92 | struct se_portal_group *tpg, |
93 | struct se_lun *lun_orig) | ||
93 | { | 94 | { |
94 | u32 lun_access = 0; | 95 | u32 lun_access = 0; |
95 | struct se_lun *lun; | 96 | struct se_lun *lun; |
@@ -99,6 +100,8 @@ void core_tpg_add_node_to_devs( | |||
99 | hlist_for_each_entry_rcu(lun, &tpg->tpg_lun_hlist, link) { | 100 | hlist_for_each_entry_rcu(lun, &tpg->tpg_lun_hlist, link) { |
100 | if (lun->lun_status != TRANSPORT_LUN_STATUS_ACTIVE) | 101 | if (lun->lun_status != TRANSPORT_LUN_STATUS_ACTIVE) |
101 | continue; | 102 | continue; |
103 | if (lun_orig && lun != lun_orig) | ||
104 | continue; | ||
102 | 105 | ||
103 | dev = lun->lun_se_dev; | 106 | dev = lun->lun_se_dev; |
104 | /* | 107 | /* |
@@ -238,7 +241,7 @@ struct se_node_acl *core_tpg_check_initiator_node_acl( | |||
238 | */ | 241 | */ |
239 | if ((tpg->se_tpg_tfo->tpg_check_demo_mode_login_only == NULL) || | 242 | if ((tpg->se_tpg_tfo->tpg_check_demo_mode_login_only == NULL) || |
240 | (tpg->se_tpg_tfo->tpg_check_demo_mode_login_only(tpg) != 1)) | 243 | (tpg->se_tpg_tfo->tpg_check_demo_mode_login_only(tpg) != 1)) |
241 | core_tpg_add_node_to_devs(acl, tpg); | 244 | core_tpg_add_node_to_devs(acl, tpg, NULL); |
242 | 245 | ||
243 | target_add_node_acl(acl); | 246 | target_add_node_acl(acl); |
244 | return acl; | 247 | return acl; |