summaryrefslogtreecommitdiffstats
path: root/drivers/target/iscsi/iscsi_target_tpg.c
diff options
context:
space:
mode:
authorDmitry Bogdanov <d.bogdanov@yadro.com>2022-05-23 12:59:03 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2022-06-07 21:55:11 -0400
commita11b80692be5c408a33ea89e3fe1a240bef8c820 (patch)
tree75392d8ec55032080d99c6f5fe5c36bedfde749f /drivers/target/iscsi/iscsi_target_tpg.c
parent4dc48a107a146cade61097958ff2366c13da1f60 (diff)
downloadlinux-a11b80692be5c408a33ea89e3fe1a240bef8c820.tar.gz
linux-a11b80692be5c408a33ea89e3fe1a240bef8c820.tar.bz2
linux-a11b80692be5c408a33ea89e3fe1a240bef8c820.zip
scsi: target: iscsi: Add upcast helpers
iSCSI target is cluttered with open-coded container_of() conversions from se_nacl to iscsi_node_acl. The code could be cleaned by introducing a helper - to_iscsi_nacl() (similar to other helpers in target core). While at it, make another iSCSI conversion helper consistent and rename iscsi_tpg() helper to to_iscsi_tpg(). Link: https://lore.kernel.org/r/20220523095905.26070-2-d.bogdanov@yadro.com Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com> Reviewed-by: Konstantin Shelekhin <k.shelekhin@yadro.com> Reviewed-by: Mike Christie <michael.christie@oracle.com> Reviewed-by: Lee Duncan <lduncan@suse.com> Signed-off-by: Dmitry Bogdanov <d.bogdanov@yadro.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/target/iscsi/iscsi_target_tpg.c')
-rw-r--r--drivers/target/iscsi/iscsi_target_tpg.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c
index 4339ee517434..3cac1aafef68 100644
--- a/drivers/target/iscsi/iscsi_target_tpg.c
+++ b/drivers/target/iscsi/iscsi_target_tpg.c
@@ -394,8 +394,7 @@ struct iscsi_node_attrib *iscsit_tpg_get_node_attrib(
{
struct se_session *se_sess = sess->se_sess;
struct se_node_acl *se_nacl = se_sess->se_node_acl;
- struct iscsi_node_acl *acl = container_of(se_nacl, struct iscsi_node_acl,
- se_node_acl);
+ struct iscsi_node_acl *acl = to_iscsi_nacl(se_nacl);
return &acl->node_attrib;
}