summaryrefslogtreecommitdiff
path: root/drivers/ide/ide-io.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-04-05 15:29:01 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2011-04-05 15:29:01 -0700
commit44148a667d3715f3a1c37eeff7e954c946cc1efe (patch)
treefd8685dd17dcef45993b733f4ec4df97e6808304 /drivers/ide/ide-io.c
parentd0de4dc584ec6aa3b26fffea320a8457827768fc (diff)
parent782b86e2656762382ae1c2686d8d5c91f7d5eacf (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-2.6-block: ide: always ensure that blk_delay_queue() is called if we have pending IO block: fix request sorting at unplug dm: improve block integrity support fs: export empty_aops ide: ide_requeue_and_plug() reinstate "always plug" behaviour blk-throttle: don't call xchg on bool ufs: remove unessecary blk_flush_plug block: make the flush insertion use the tail of the dispatch list block: get rid of elv_insert() interface block: dump request state on seeing a corrupted request completion
Diffstat (limited to 'drivers/ide/ide-io.c')
-rw-r--r--drivers/ide/ide-io.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c
index 0e406d73b2c8..177db6d5b2f5 100644
--- a/drivers/ide/ide-io.c
+++ b/drivers/ide/ide-io.c
@@ -430,6 +430,26 @@ static inline void ide_unlock_host(struct ide_host *host)
}
}
+static void __ide_requeue_and_plug(struct request_queue *q, struct request *rq)
+{
+ if (rq)
+ blk_requeue_request(q, rq);
+ if (rq || blk_peek_request(q)) {
+ /* Use 3ms as that was the old plug delay */
+ blk_delay_queue(q, 3);
+ }
+}
+
+void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq)
+{
+ struct request_queue *q = drive->queue;
+ unsigned long flags;
+
+ spin_lock_irqsave(q->queue_lock, flags);
+ __ide_requeue_and_plug(q, rq);
+ spin_unlock_irqrestore(q->queue_lock, flags);
+}
+
/*
* Issue a new request to a device.
*/
@@ -550,28 +570,7 @@ plug_device:
ide_unlock_host(host);
plug_device_2:
spin_lock_irq(q->queue_lock);
-
- if (rq) {
- blk_requeue_request(q, rq);
- blk_delay_queue(q, queue_run_ms);
- }
-}
-
-void ide_requeue_and_plug(ide_drive_t *drive, struct request *rq)
-{
- struct request_queue *q = drive->queue;
- unsigned long flags;
-
- spin_lock_irqsave(q->queue_lock, flags);
-
- if (rq)
- blk_requeue_request(q, rq);
-
- spin_unlock_irqrestore(q->queue_lock, flags);
-
- /* Use 3ms as that was the old plug delay */
- if (rq)
- blk_delay_queue(q, 3);
+ __ide_requeue_and_plug(q, rq);
}
static int drive_is_ready(ide_drive_t *drive)