summaryrefslogtreecommitdiffstats
path: root/fs/direct-io.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-03-03 16:04:02 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2016-03-04 12:20:10 -0500
commitc43c83a294e8dc25072ca9e6fca4cdbc5564f3d4 (patch)
tree2d44bfc5c5cbae4db6c24c64f1bdc91761c37f1f /fs/direct-io.c
parent97be7ebe53915af504fb491fb99f064c7cf3cb09 (diff)
downloadlinux-stable-c43c83a294e8dc25072ca9e6fca4cdbc5564f3d4.tar.gz
linux-stable-c43c83a294e8dc25072ca9e6fca4cdbc5564f3d4.tar.bz2
linux-stable-c43c83a294e8dc25072ca9e6fca4cdbc5564f3d4.zip
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>
Diffstat (limited to 'fs/direct-io.c')
-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)
__set_current_state(TASK_UNINTERRUPTIBLE);
dio->waiter = current;
spin_unlock_irqrestore(&dio->bio_lock, flags);
- if (!blk_poll(bdev_get_queue(dio->bio_bdev), dio->bio_cookie))
+ if (!(dio->iocb->ki_flags & IOCB_HIPRI) ||
+ !blk_poll(bdev_get_queue(dio->bio_bdev), dio->bio_cookie))
io_schedule();
/* wake up sets us TASK_RUNNING */
spin_lock_irqsave(&dio->bio_lock, flags);