aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-03-03 10:04:02 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2016-03-04 12:20:10 -0500
commitc43c83a294e8dc25072ca9e6fca4cdbc5564f3d4 (patch)
tree2d44bfc5c5cbae4db6c24c64f1bdc91761c37f1f
parent97be7ebe53915af504fb491fb99f064c7cf3cb09 (diff)
direct-io: only use block polling if explicitly requested
Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Stephen Bates <stephen.bates@pmcs.com> Tested-by: Stephen Bates <stephen.bates@pmcs.com> Acked-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/direct-io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/direct-io.c b/fs/direct-io.c
index 1b2f7ffc8b84..85463171053b 100644
--- a/fs/direct-io.c
+++ b/fs/direct-io.c
@@ -445,7 +445,8 @@ static struct bio *dio_await_one(struct dio *dio)
445 __set_current_state(TASK_UNINTERRUPTIBLE); 445 __set_current_state(TASK_UNINTERRUPTIBLE);
446 dio->waiter = current; 446 dio->waiter = current;
447 spin_unlock_irqrestore(&dio->bio_lock, flags); 447 spin_unlock_irqrestore(&dio->bio_lock, flags);
448 if (!blk_poll(bdev_get_queue(dio->bio_bdev), dio->bio_cookie)) 448 if (!(dio->iocb->ki_flags & IOCB_HIPRI) ||
449 !blk_poll(bdev_get_queue(dio->bio_bdev), dio->bio_cookie))
449 io_schedule(); 450 io_schedule();
450 /* wake up sets us TASK_RUNNING */ 451 /* wake up sets us TASK_RUNNING */
451 spin_lock_irqsave(&dio->bio_lock, flags); 452 spin_lock_irqsave(&dio->bio_lock, flags);