Skip to contentSkip to conversation

target: add session removal function

PATCH Applied Mike Christie 1 participant 1 message Aug 2, 2018 SCSI target

lore
Share & tools
lore
#0 lore raw

PATCH 5/8 target: add session removal function

This adds a function to remove a session which should be used by drivers that use target_setup_session. The next patches will convert the target drivers to use this new function.

Cc Chris Boot <[email protected]>
Cc Bryant G. Ly <[email protected]>
Cc Michael Cyr <[email protected]>
Cc Johannes Thumshirn <[email protected]>
Cc Felipe Balbi <[email protected]>
Cc Sebastian Andrzej Siewior <[email protected]>
Cc Andrzej Pietrasiewicz <[email protected]>
Cc Michael S. Tsirkin <[email protected]>
Cc Juergen Gross <[email protected]>
---
 drivers/target/target_core_transport.c | 7 +++++++
 include/target/target_core_fabric.h    | 1 +
 2 files changed, 8 insertions(+)
drivers/target/target_core_transport.c +7 -0
index 57fadec..86c0156 100644
@@ -616,6 +616,13 @@ void transport_deregister_session(struct se_session *se_sess)
 }
 EXPORT_SYMBOL(transport_deregister_session);
 
+void target_remove_session(struct se_session *se_sess)
+{
+	transport_deregister_session_configfs(se_sess);
+	transport_deregister_session(se_sess);
+}
+EXPORT_SYMBOL(target_remove_session);
+
 static void target_remove_from_state_list(struct se_cmd *cmd)
 {
 	struct se_device *dev = cmd->se_dev;
include/target/target_core_fabric.h +1 -0
index fbcc9a4..f4147b3 100644
@@ -114,6 +114,7 @@ struct se_session *target_setup_session(struct se_portal_group *,
 		const char *, void *,
 		int (*callback)(struct se_portal_group *,
 				struct se_session *, void *));
+void target_remove_session(struct se_session *);
 
 void transport_init_session(struct se_session *);
 struct se_session *transport_alloc_session(enum target_prot_op);
Signature · 1 line
2.7.2