aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/scsi_lib.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2006-01-09 10:03:03 -0500
committerJens Axboe <axboe@suse.de>2006-01-09 10:03:03 -0500
commit1aea6434eebd25e532d2e5ddabf2733af4e1ff0b (patch)
treeb82aa8135d9c9f01a779be1977c0398cf2b406a8 /drivers/scsi/scsi_lib.c
parentff856bad67cb65cb4dc4ef88b808804fc4265782 (diff)
[SCSI] Kill the SCSI softirq handling
This patch moves the SCSI softirq handling to the block layer version. There should be no functional changes. Signed-off-by: Jens Axboe <axboe@suse.de>
Diffstat (limited to 'drivers/scsi/scsi_lib.c')
-rw-r--r--drivers/scsi/scsi_lib.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index ba93d6e66d48..00c9bf383e23 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1493,6 +1493,41 @@ static void scsi_kill_request(struct request *req, request_queue_t *q)
1493 __scsi_done(cmd); 1493 __scsi_done(cmd);
1494} 1494}
1495 1495
1496static void scsi_softirq_done(struct request *rq)
1497{
1498 struct scsi_cmnd *cmd = rq->completion_data;
1499 unsigned long wait_for = cmd->allowed * cmd->timeout_per_command;
1500 int disposition;
1501
1502 INIT_LIST_HEAD(&cmd->eh_entry);
1503
1504 disposition = scsi_decide_disposition(cmd);
1505 if (disposition != SUCCESS &&
1506 time_before(cmd->jiffies_at_alloc + wait_for, jiffies)) {
1507 sdev_printk(KERN_ERR, cmd->device,
1508 "timing out command, waited %lus\n",
1509 wait_for/HZ);
1510 disposition = SUCCESS;
1511 }
1512
1513 scsi_log_completion(cmd, disposition);
1514
1515 switch (disposition) {
1516 case SUCCESS:
1517 scsi_finish_command(cmd);
1518 break;
1519 case NEEDS_RETRY:
1520 scsi_retry_command(cmd);
1521 break;
1522 case ADD_TO_MLQUEUE:
1523 scsi_queue_insert(cmd, SCSI_MLQUEUE_DEVICE_BUSY);
1524 break;
1525 default:
1526 if (!scsi_eh_scmd_add(cmd, 0))
1527 scsi_finish_command(cmd);
1528 }
1529}
1530
1496/* 1531/*
1497 * Function: scsi_request_fn() 1532 * Function: scsi_request_fn()
1498 * 1533 *
@@ -1667,6 +1702,7 @@ struct request_queue *scsi_alloc_queue(struct scsi_device *sdev)
1667 blk_queue_bounce_limit(q, scsi_calculate_bounce_limit(shost)); 1702 blk_queue_bounce_limit(q, scsi_calculate_bounce_limit(shost));
1668 blk_queue_segment_boundary(q, shost->dma_boundary); 1703 blk_queue_segment_boundary(q, shost->dma_boundary);
1669 blk_queue_issue_flush_fn(q, scsi_issue_flush_fn); 1704 blk_queue_issue_flush_fn(q, scsi_issue_flush_fn);
1705 blk_queue_softirq_done(q, scsi_softirq_done);
1670 1706
1671 if (!shost->use_clustering) 1707 if (!shost->use_clustering)
1672 clear_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags); 1708 clear_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags);