From d4ee46ff8c8404d63779772e4ddb3553eaca26ae Mon Sep 17 00:00:00 2001 From: Nicholas Bellinger Date: Fri, 6 Mar 2015 20:40:57 -0800 Subject: [PATCH] iscsi-target: Expose per endpoint dynamic_sessions attribute This patch exposes a new ../iscsi/$IQN/$TPGT/dynamic_sessions attribute to dump the currently active sessions by iSCSI InitiatorName that have been created with dynamically generated se_node_acls. This information is useful so that user-space can optionally perform dynamic -> explicit NodeACL conversion based on $INITIATOR_WWPN. Signed-off-by: Nicholas Bellinger --- drivers/target/iscsi/iscsi_target_configfs.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/target/iscsi/iscsi_target_configfs.c b/drivers/target/iscsi/iscsi_target_configfs.c index 48384b675e62..95a67f604073 100644 --- a/drivers/target/iscsi/iscsi_target_configfs.c +++ b/drivers/target/iscsi/iscsi_target_configfs.c @@ -1410,8 +1410,18 @@ out: TF_TPG_BASE_ATTR(lio_target, enable, S_IRUGO | S_IWUSR); +static ssize_t lio_target_tpg_show_dynamic_sessions( + struct se_portal_group *se_tpg, + char *page) +{ + return target_show_dynamic_sessions(se_tpg, page); +} + +TF_TPG_BASE_ATTR_RO(lio_target, dynamic_sessions); + static struct configfs_attribute *lio_target_tpg_attrs[] = { &lio_target_tpg_enable.attr, + &lio_target_tpg_dynamic_sessions.attr, NULL, }; -- 2.34.1