Make it possible to forcibly close SRP and FC sessions via sysfs

That patch contains the following changes:
* Move the code for creating a "close_sess" sysfs attribute from iscsi-scst to
  the SCST core such that it becomes available for other target drivers. This
  does not change the functionality of iscsi-scst.
* Add code in ib_srpt and qla2x00t to allow a session to be forcibly closed from
  user space.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>




git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4852 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2013-05-18 00:52:46 +00:00
parent 90222db2ac
commit 2093dd7561
6 changed files with 89 additions and 31 deletions
+9
View File
@@ -3528,6 +3528,14 @@ static int srpt_detect(struct scst_tgt_template *tp)
return device_count;
}
static int srpt_close_session(struct scst_session *sess)
{
struct srpt_rdma_ch *ch = scst_sess_get_tgt_priv(sess);
srpt_close_ch(ch);
return 0;
}
static int srpt_ch_list_empty(struct srpt_tgt *srpt_tgt)
{
int res;
@@ -3752,6 +3760,7 @@ static struct scst_tgt_template srpt_template = {
.on_hw_pending_cmd_timeout = srpt_pending_cmd_timeout,
.on_free_cmd = srpt_on_free_cmd,
.task_mgmt_fn_done = srpt_tsk_mgmt_done,
.close_session = srpt_close_session,
.get_initiator_port_transport_id = srpt_get_initiator_port_transport_id,
.get_scsi_transport_version = srpt_get_scsi_transport_version,
};