diff options
author | Luben Tuikov <ltuikov@yahoo.com> | 2006-05-15 20:57:18 +0900 |
---|---|---|
committer | Tejun Heo <htejun@gmail.com> | 2006-05-15 20:57:18 +0900 |
commit | 89f48c4d67dd875cf2216d4402bf77eda41fbdd9 (patch) | |
tree | 72f8664d7029f0190557b1b9f437b35e047cfd95 /drivers/scsi/scsi.c | |
parent | acc696d93dcf993dec123d69d599979e1456ffec (diff) | |
download | talos-obmc-linux-89f48c4d67dd875cf2216d4402bf77eda41fbdd9.tar.gz talos-obmc-linux-89f48c4d67dd875cf2216d4402bf77eda41fbdd9.zip |
[PATCH] SCSI: Introduce scsi_req_abort_cmd (REPOST)
Introduce scsi_req_abort_cmd(struct scsi_cmnd *).
This function requests that SCSI Core start recovery for the
command by deleting the timer and adding the command to the eh
queue. It can be called by either LLDDs or SCSI Core. LLDDs who
implement their own error recovery MAY ignore the timeout event if
they generated scsi_req_abort_cmd.
First post:
http://marc.theaimsgroup.com/?l=linux-scsi&m=113833937421677&w=2
Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Tejun Heo <htejun@gmail.com>
Diffstat (limited to 'drivers/scsi/scsi.c')
-rw-r--r-- | drivers/scsi/scsi.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c index 73994e2ac2cb..dae4f08adde0 100644 --- a/drivers/scsi/scsi.c +++ b/drivers/scsi/scsi.c @@ -720,6 +720,24 @@ void scsi_init_cmd_from_req(struct scsi_cmnd *cmd, struct scsi_request *sreq) static DEFINE_PER_CPU(struct list_head, scsi_done_q); /** + * scsi_req_abort_cmd -- Request command recovery for the specified command + * cmd: pointer to the SCSI command of interest + * + * This function requests that SCSI Core start recovery for the + * command by deleting the timer and adding the command to the eh + * queue. It can be called by either LLDDs or SCSI Core. LLDDs who + * implement their own error recovery MAY ignore the timeout event if + * they generated scsi_req_abort_cmd. + */ +void scsi_req_abort_cmd(struct scsi_cmnd *cmd) +{ + if (!scsi_delete_timer(cmd)) + return; + scsi_times_out(cmd); +} +EXPORT_SYMBOL(scsi_req_abort_cmd); + +/** * scsi_done - Enqueue the finished SCSI command into the done queue. * @cmd: The SCSI Command for which a low-level device driver (LLDD) gives * ownership back to SCSI Core -- i.e. the LLDD has finished with it. |