diff options
author | Joern Engel <joern@logfs.org> | 2012-05-18 16:57:19 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2012-06-12 22:33:05 -0400 |
commit | 4149268e7816d719b0fde8e89aaa6db8c168fc43 (patch) | |
tree | 3c180fca14317541addad2cf65e0d5ad5b01bc3d /drivers/target | |
parent | cfaf025112d3856637ff34a767ef785ef5cf2ca9 (diff) |
target: Add TFO->put_session() caller for HW fabric session shutdown
This patch adds an optional target_core_fabric_ops->put_session() caller
within the existing target_put_session() code path.
This is required by tcm_qla2xxx code in order to invoke it's own fabric
specific session shutdown handler using se_session->sess_kref.
Signed-off-by: Joern Engel <joern@logfs.org>
Cc: Roland Dreier <roland@purestorage.com>
Cc: Arun Easi <arun.easi@qlogic.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/target_core_transport.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c index b05fdc0c05d3..634d0f31a28c 100644 --- a/drivers/target/target_core_transport.c +++ b/drivers/target/target_core_transport.c | |||
@@ -315,7 +315,7 @@ void transport_register_session( | |||
315 | } | 315 | } |
316 | EXPORT_SYMBOL(transport_register_session); | 316 | EXPORT_SYMBOL(transport_register_session); |
317 | 317 | ||
318 | static void target_release_session(struct kref *kref) | 318 | void target_release_session(struct kref *kref) |
319 | { | 319 | { |
320 | struct se_session *se_sess = container_of(kref, | 320 | struct se_session *se_sess = container_of(kref, |
321 | struct se_session, sess_kref); | 321 | struct se_session, sess_kref); |
@@ -332,6 +332,12 @@ EXPORT_SYMBOL(target_get_session); | |||
332 | 332 | ||
333 | void target_put_session(struct se_session *se_sess) | 333 | void target_put_session(struct se_session *se_sess) |
334 | { | 334 | { |
335 | struct se_portal_group *tpg = se_sess->se_tpg; | ||
336 | |||
337 | if (tpg->se_tpg_tfo->put_session != NULL) { | ||
338 | tpg->se_tpg_tfo->put_session(se_sess); | ||
339 | return; | ||
340 | } | ||
335 | kref_put(&se_sess->sess_kref, target_release_session); | 341 | kref_put(&se_sess->sess_kref, target_release_session); |
336 | } | 342 | } |
337 | EXPORT_SYMBOL(target_put_session); | 343 | EXPORT_SYMBOL(target_put_session); |