alistair23-linux/drivers/target
Nicholas Bellinger a17f091d1a target: Add generic active I/O shutdown logic
This patch adds the initial pieces of generic active I/O shutdown logic.
This is intended to be a 'opt-in' feature for fabric modules that
includes the following functions to provide a mechinism for fabric
modules to track se_cmd via se_session->sess_cmd_list:

*) target_get_sess_cmd() - Add se_cmd to sess->sess_cmd_list, called
   from fabric module incoming I/O path.
*) target_put_sess_cmd() - Check for completion or drop se_cmd from
   ->sess_cmd_list
*) target_splice_sess_cmd_list() - Splice active I/O list from
   ->sess_cmd_list to ->sess_wait_list, can called with HW fabric
   lock held.
*) target_wait_for_sess_cmds() - Walk ->sess_wait_list waiting on
   individual ->cmd_wait_comp.  Optional transport_wait_for_tasks()
   call.

target_splice_sess_cmd_list() is allowed to be called under HW fabric
lock, and performs the splice into se_sess->sess_wait_list and set
se_cmd->cmd_wait_set.  Then target_wait_for_sess_cmds() walks the list
waiting for individual target_put_sess_cmd() fabric callbacks to
complete.

It also adds TFO->check_release_cmd() to split the completion and memory
release calls, where a fabric module uses target_put_sess_cmd() to check
for I/O completion during session shutdown.  This is currently pushed out
into fabric modules as current fabric code may sleep here waiting for
TFO->check_stop_free() to complete in main response path, and because
target_wait_for_sess_cmds() calling TFO->release_cmd() to free fabric
descriptor memory directly.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas A. Bellinger <nab@linux-iscsi.org>
2011-11-04 07:50:26 +00:00
..
iscsi iscsi-target: Fix non-immediate TMR handling 2011-11-02 15:57:13 +00:00
loopback target: Make TFO->check_stop_free return free status 2011-11-02 15:58:30 +00:00
tcm_fc target: Make TFO->check_stop_free return free status 2011-11-02 15:58:30 +00:00
Kconfig iscsi-target: Add iSCSI fabric support for target v4.1 2011-07-26 09:16:43 +00:00
Makefile target: remove the ->transport_split_cdb callback in se_cmd 2011-10-24 03:21:15 +00:00
target_core_alua.c target: Fix REPORT TARGET PORT GROUPS handling with small allocation length 2011-10-24 03:21:19 +00:00
target_core_alua.h [SCSI] target: Add LIO target core v4.0.0-rc6 2011-01-14 10:12:29 -06:00
target_core_cdb.c target: Fix compile warning w/ missing module.h include 2011-10-26 20:42:13 +00:00
target_core_configfs.c target: Remove legacy se_task->task_timer and associated logic 2011-10-24 03:22:08 +00:00
target_core_device.c target: Remove legacy se_task->task_timer and associated logic 2011-10-24 03:22:08 +00:00
target_core_fabric_configfs.c target: Remove unneeded version.h includes 2011-10-11 04:10:19 +00:00
target_core_fabric_lib.c target: remove custom hex2bin() implementation 2011-07-22 09:37:49 +00:00
target_core_file.c target: clean up the backend interface to caching parameters 2011-10-24 03:21:31 +00:00
target_core_file.h target: make the ->get_cdb method optional 2011-10-24 03:21:11 +00:00
target_core_hba.c target: Follow up core updates from AGrover and HCH (round 4) 2011-07-22 09:37:48 +00:00
target_core_hba.h [SCSI] target: Add LIO target core v4.0.0-rc6 2011-01-14 10:12:29 -06:00
target_core_iblock.c target: clean up the backend interface to caching parameters 2011-10-24 03:21:31 +00:00
target_core_iblock.h target: make the ->get_cdb method optional 2011-10-24 03:21:11 +00:00
target_core_pr.c target: Remove unneeded version.h includes 2011-10-11 04:10:19 +00:00
target_core_pr.h target: Core cleanups from AGrover (round 1) 2011-07-22 09:37:43 +00:00
target_core_pscsi.c target/pscsi: blk_make_request() returns an ERR_PTR() 2011-11-02 15:58:47 +00:00
target_core_pscsi.h target: cleanup pscsi request submission 2011-10-24 03:20:44 +00:00
target_core_rd.c target: make the ->get_cdb method optional 2011-10-24 03:21:11 +00:00
target_core_rd.h target: make the ->get_cdb method optional 2011-10-24 03:21:11 +00:00
target_core_stat.c target: Remove unneeded version.h includes 2011-10-11 04:10:19 +00:00
target_core_stat.h [SCSI] target: add initial statistics 2011-03-23 11:36:50 -05:00
target_core_tmr.c target: Remove core TRANSPORT_FREE_CMD_INTR usage 2011-11-02 15:58:46 +00:00
target_core_tpg.c target: Convert acl_node_lock to be IRQ-disabling 2011-08-22 19:28:36 +00:00
target_core_transport.c target: Add generic active I/O shutdown logic 2011-11-04 07:50:26 +00:00
target_core_ua.c target: Remove unneeded version.h includes 2011-10-11 04:10:19 +00:00
target_core_ua.h [SCSI] target: Add LIO target core v4.0.0-rc6 2011-01-14 10:12:29 -06:00