diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:18:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-29 11:18:03 -0400 |
commit | bd5d435a96837c3495e62eef37cbe4cb728b79ae (patch) | |
tree | 82aacaf5a1d220910c4b0a1088d7d2482c0d9ee0 /drivers/scsi | |
parent | fee4b19fb3f28d17c0b9f9ea0668db5275697178 (diff) | |
parent | ac9fafa1243640349aa481adf473db283a695766 (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
block: Skip I/O merges when disabled
block: add large command support
block: replace sizeof(rq->cmd) with BLK_MAX_CDB
ide: use blk_rq_init() to initialize the request
block: use blk_rq_init() to initialize the request
block: rename and export rq_init()
block: no need to initialize rq->cmd with blk_get_request
block: no need to initialize rq->cmd in prepare_flush_fn hook
block/blk-barrier.c:blk_ordered_cur_seq() mustn't be inline
block/elevator.c:elv_rq_merge_ok() mustn't be inline
block: make queue flags non-atomic
block: add dma alignment and padding support to blk_rq_map_kern
unexport blk_max_pfn
ps3disk: Remove superfluous cast
block: make rq_init() do a full memset()
relay: fix splice problem
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/scsi_debug.c | 2 | ||||
-rw-r--r-- | drivers/scsi/scsi_error.c | 1 | ||||
-rw-r--r-- | drivers/scsi/scsi_lib.c | 31 | ||||
-rw-r--r-- | drivers/scsi/scsi_transport_sas.c | 3 | ||||
-rw-r--r-- | drivers/scsi/sd.c | 1 |
5 files changed, 21 insertions, 17 deletions
diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index 07103c399fe0..f6600bfb5bde 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c | |||
@@ -1773,7 +1773,7 @@ static int scsi_debug_slave_alloc(struct scsi_device *sdp) | |||
1773 | if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) | 1773 | if (SCSI_DEBUG_OPT_NOISE & scsi_debug_opts) |
1774 | printk(KERN_INFO "scsi_debug: slave_alloc <%u %u %u %u>\n", | 1774 | printk(KERN_INFO "scsi_debug: slave_alloc <%u %u %u %u>\n", |
1775 | sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); | 1775 | sdp->host->host_no, sdp->channel, sdp->id, sdp->lun); |
1776 | set_bit(QUEUE_FLAG_BIDI, &sdp->request_queue->queue_flags); | 1776 | queue_flag_set_unlocked(QUEUE_FLAG_BIDI, sdp->request_queue); |
1777 | return 0; | 1777 | return 0; |
1778 | } | 1778 | } |
1779 | 1779 | ||
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 221f31e36d26..1eaba6cd80f4 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -1771,6 +1771,7 @@ scsi_reset_provider(struct scsi_device *dev, int flag) | |||
1771 | unsigned long flags; | 1771 | unsigned long flags; |
1772 | int rtn; | 1772 | int rtn; |
1773 | 1773 | ||
1774 | blk_rq_init(NULL, &req); | ||
1774 | scmd->request = &req; | 1775 | scmd->request = &req; |
1775 | memset(&scmd->eh_timeout, 0, sizeof(scmd->eh_timeout)); | 1776 | memset(&scmd->eh_timeout, 0, sizeof(scmd->eh_timeout)); |
1776 | 1777 | ||
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 67f412bb4974..d545ad1cf47a 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -536,6 +536,9 @@ static void scsi_run_queue(struct request_queue *q) | |||
536 | !shost->host_blocked && !shost->host_self_blocked && | 536 | !shost->host_blocked && !shost->host_self_blocked && |
537 | !((shost->can_queue > 0) && | 537 | !((shost->can_queue > 0) && |
538 | (shost->host_busy >= shost->can_queue))) { | 538 | (shost->host_busy >= shost->can_queue))) { |
539 | |||
540 | int flagset; | ||
541 | |||
539 | /* | 542 | /* |
540 | * As long as shost is accepting commands and we have | 543 | * As long as shost is accepting commands and we have |
541 | * starved queues, call blk_run_queue. scsi_request_fn | 544 | * starved queues, call blk_run_queue. scsi_request_fn |
@@ -549,19 +552,20 @@ static void scsi_run_queue(struct request_queue *q) | |||
549 | sdev = list_entry(shost->starved_list.next, | 552 | sdev = list_entry(shost->starved_list.next, |
550 | struct scsi_device, starved_entry); | 553 | struct scsi_device, starved_entry); |
551 | list_del_init(&sdev->starved_entry); | 554 | list_del_init(&sdev->starved_entry); |
552 | spin_unlock_irqrestore(shost->host_lock, flags); | 555 | spin_unlock(shost->host_lock); |
553 | 556 | ||
557 | spin_lock(sdev->request_queue->queue_lock); | ||
558 | flagset = test_bit(QUEUE_FLAG_REENTER, &q->queue_flags) && | ||
559 | !test_bit(QUEUE_FLAG_REENTER, | ||
560 | &sdev->request_queue->queue_flags); | ||
561 | if (flagset) | ||
562 | queue_flag_set(QUEUE_FLAG_REENTER, sdev->request_queue); | ||
563 | __blk_run_queue(sdev->request_queue); | ||
564 | if (flagset) | ||
565 | queue_flag_clear(QUEUE_FLAG_REENTER, sdev->request_queue); | ||
566 | spin_unlock(sdev->request_queue->queue_lock); | ||
554 | 567 | ||
555 | if (test_bit(QUEUE_FLAG_REENTER, &q->queue_flags) && | 568 | spin_lock(shost->host_lock); |
556 | !test_and_set_bit(QUEUE_FLAG_REENTER, | ||
557 | &sdev->request_queue->queue_flags)) { | ||
558 | blk_run_queue(sdev->request_queue); | ||
559 | clear_bit(QUEUE_FLAG_REENTER, | ||
560 | &sdev->request_queue->queue_flags); | ||
561 | } else | ||
562 | blk_run_queue(sdev->request_queue); | ||
563 | |||
564 | spin_lock_irqsave(shost->host_lock, flags); | ||
565 | if (unlikely(!list_empty(&sdev->starved_entry))) | 569 | if (unlikely(!list_empty(&sdev->starved_entry))) |
566 | /* | 570 | /* |
567 | * sdev lost a race, and was put back on the | 571 | * sdev lost a race, and was put back on the |
@@ -1585,8 +1589,9 @@ struct request_queue *__scsi_alloc_queue(struct Scsi_Host *shost, | |||
1585 | 1589 | ||
1586 | blk_queue_max_segment_size(q, dma_get_max_seg_size(dev)); | 1590 | blk_queue_max_segment_size(q, dma_get_max_seg_size(dev)); |
1587 | 1591 | ||
1592 | /* New queue, no concurrency on queue_flags */ | ||
1588 | if (!shost->use_clustering) | 1593 | if (!shost->use_clustering) |
1589 | clear_bit(QUEUE_FLAG_CLUSTER, &q->queue_flags); | 1594 | queue_flag_clear_unlocked(QUEUE_FLAG_CLUSTER, q); |
1590 | 1595 | ||
1591 | /* | 1596 | /* |
1592 | * set a reasonable default alignment on word boundaries: the | 1597 | * set a reasonable default alignment on word boundaries: the |
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c index 7899e3dda9bf..f4461d35ffb9 100644 --- a/drivers/scsi/scsi_transport_sas.c +++ b/drivers/scsi/scsi_transport_sas.c | |||
@@ -248,8 +248,7 @@ static int sas_bsg_initialize(struct Scsi_Host *shost, struct sas_rphy *rphy) | |||
248 | else | 248 | else |
249 | q->queuedata = shost; | 249 | q->queuedata = shost; |
250 | 250 | ||
251 | set_bit(QUEUE_FLAG_BIDI, &q->queue_flags); | 251 | queue_flag_set_unlocked(QUEUE_FLAG_BIDI, q); |
252 | |||
253 | return 0; | 252 | return 0; |
254 | } | 253 | } |
255 | 254 | ||
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 3cea17dd5dba..01cefbb2d539 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -860,7 +860,6 @@ static int sd_sync_cache(struct scsi_disk *sdkp) | |||
860 | 860 | ||
861 | static void sd_prepare_flush(struct request_queue *q, struct request *rq) | 861 | static void sd_prepare_flush(struct request_queue *q, struct request *rq) |
862 | { | 862 | { |
863 | memset(rq->cmd, 0, sizeof(rq->cmd)); | ||
864 | rq->cmd_type = REQ_TYPE_BLOCK_PC; | 863 | rq->cmd_type = REQ_TYPE_BLOCK_PC; |
865 | rq->timeout = SD_TIMEOUT; | 864 | rq->timeout = SD_TIMEOUT; |
866 | rq->cmd[0] = SYNCHRONIZE_CACHE; | 865 | rq->cmd[0] = SYNCHRONIZE_CACHE; |