block: unify request timeout handling

Right now SCSI and others do their own command timeout handling.
Move those bits to the block layer.

Instead of having a timer per command, we try to be a bit more clever
and simply have one per-queue. This avoids the overhead of having to
tear down and setup a timer for each command, so it will result in a lot
less timer fiddling.

Signed-off-by: Mike Anderson <andmike@linux.vnet.ibm.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
This commit is contained in:
Jens Axboe
2008-09-14 05:55:09 -07:00
parent 608aeef17a
commit 242f9dcb8b
39 changed files with 399 additions and 339 deletions

View File

@@ -75,7 +75,6 @@ struct scsi_cmnd {
int retries;
int allowed;
int timeout_per_command;
unsigned char prot_op;
unsigned char prot_type;
@@ -86,7 +85,6 @@ struct scsi_cmnd {
/* These elements define the operation we are about to perform */
unsigned char *cmnd;
struct timer_list eh_timeout; /* Used to time out the command. */
/* These elements define the operation we ultimately want to perform */
struct scsi_data_buffer sdb;
@@ -139,7 +137,6 @@ extern void scsi_put_command(struct scsi_cmnd *);
extern void __scsi_put_command(struct Scsi_Host *, struct scsi_cmnd *,
struct device *);
extern void scsi_finish_command(struct scsi_cmnd *cmd);
extern void scsi_req_abort_cmd(struct scsi_cmnd *cmd);
extern void *scsi_kmap_atomic_sg(struct scatterlist *sg, int sg_count,
size_t *offset, size_t *len);

View File

@@ -43,13 +43,6 @@ struct blk_queue_tags;
#define DISABLE_CLUSTERING 0
#define ENABLE_CLUSTERING 1
enum scsi_eh_timer_return {
EH_NOT_HANDLED,
EH_HANDLED,
EH_RESET_TIMER,
};
struct scsi_host_template {
struct module *module;
const char *name;
@@ -347,7 +340,7 @@ struct scsi_host_template {
*
* Status: OPTIONAL
*/
enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *);
enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd *);
/*
* Name of proc directory

View File

@@ -21,6 +21,7 @@
#define SCSI_TRANSPORT_H
#include <linux/transport_class.h>
#include <linux/blkdev.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_device.h>
@@ -64,7 +65,7 @@ struct scsi_transport_template {
* begin counting again
* EH_NOT_HANDLED Begin normal error recovery
*/
enum scsi_eh_timer_return (* eh_timed_out)(struct scsi_cmnd *);
enum blk_eh_timer_return (*eh_timed_out)(struct scsi_cmnd *);
/*
* Used as callback for the completion of i_t_nexus request