]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] SCSI: Introduce scsi_req_abort_cmd (REPOST)
authorLuben Tuikov <ltuikov@yahoo.com>
Mon, 15 May 2006 11:57:18 +0000 (20:57 +0900)
committerTejun Heo <htejun@gmail.com>
Mon, 15 May 2006 11:57:18 +0000 (20:57 +0900)
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>
drivers/scsi/scsi.c
include/scsi/scsi_cmnd.h

index 73994e2ac2cb73e3636042945511735bbb17a13f..dae4f08adde08070c8f5394695e4431208db2a1f 100644 (file)
@@ -719,6 +719,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
index 1ace1b9fe537328e41f9e369fa51c7cdcbd96e1a..88c6c4da6c054d0d7b5b1a9dedff6a540e7a3be9 100644 (file)
@@ -151,5 +151,6 @@ extern struct scsi_cmnd *scsi_get_command(struct scsi_device *, gfp_t);
 extern void scsi_put_command(struct scsi_cmnd *);
 extern void scsi_io_completion(struct scsi_cmnd *, unsigned int, unsigned int);
 extern void scsi_finish_command(struct scsi_cmnd *cmd);
+extern void scsi_req_abort_cmd(struct scsi_cmnd *cmd);
 
 #endif /* _SCSI_SCSI_CMND_H */