summaryrefslogtreecommitdiffstats
path: root/fs/block_dev.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2016-12-22 19:20:45 +0100
committerJens Axboe <axboe@fb.com>2016-12-22 11:48:20 -0700
commit64d656a162d7ba49d6d1863e41407b0f95e19258 (patch)
treee72df1d32758ffaaa552b2c3ae2f991510a405b7 /fs/block_dev.c
parent50f6584e4c626b8fa39edb66f33fec27bab3996c (diff)
downloadlinux-64d656a162d7ba49d6d1863e41407b0f95e19258.tar.gz
linux-64d656a162d7ba49d6d1863e41407b0f95e19258.tar.bz2
linux-64d656a162d7ba49d6d1863e41407b0f95e19258.zip
block: add back plugging in __blkdev_direct_IO
This allows sending larger than 1 MB requests to devices that support large I/O sizes. Signed-off-by: Christoph Hellwig <hch@lst.de> Reported-by: Laurence Oberman <loberman@redhat.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'fs/block_dev.c')
-rw-r--r--fs/block_dev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 7c4507224ed6..206a92aab52e 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -328,6 +328,7 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages)
struct file *file = iocb->ki_filp;
struct inode *inode = bdev_file_inode(file);
struct block_device *bdev = I_BDEV(inode);
+ struct blk_plug plug;
struct blkdev_dio *dio;
struct bio *bio;
bool is_read = (iov_iter_rw(iter) == READ);
@@ -353,6 +354,7 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages)
dio->multi_bio = false;
dio->should_dirty = is_read && (iter->type == ITER_IOVEC);
+ blk_start_plug(&plug);
for (;;) {
bio->bi_bdev = bdev;
bio->bi_iter.bi_sector = pos >> 9;
@@ -394,6 +396,7 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter *iter, int nr_pages)
submit_bio(bio);
bio = bio_alloc(GFP_KERNEL, nr_pages);
}
+ blk_finish_plug(&plug);
if (!dio->is_sync)
return -EIOCBQUEUED;