[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[RFC PATCH 13/34] block: use bio_new in __blkdev_direct_IO
- To: linux-xfs@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, dm-devel@xxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, drbd-dev@xxxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, linux-nvme@xxxxxxxxxxxxxxxxxxx, linux-scsi@xxxxxxxxxxxxxxx, target-devel@xxxxxxxxxxxxxxx, linux-fscrypt@xxxxxxxxxxxxxxx, jfs-discussion@xxxxxxxxxxxxxxxxxxxxx, linux-nilfs@xxxxxxxxxxxxxxx, ocfs2-devel@xxxxxxxxxxxxxx, linux-pm@xxxxxxxxxxxxxxx, linux-mm@xxxxxxxxx
- From: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
- Date: Wed, 27 Jan 2021 23:11:12 -0800
- Cc: axboe@xxxxxxxxx, philipp.reisner@xxxxxxxxxx, lars.ellenberg@xxxxxxxxxx, konrad.wilk@xxxxxxxxxx, roger.pau@xxxxxxxxxx, minchan@xxxxxxxxxx, ngupta@xxxxxxxxxx, sergey.senozhatsky.work@xxxxxxxxx, agk@xxxxxxxxxx, snitzer@xxxxxxxxxx, hch@xxxxxx, sagi@xxxxxxxxxxx, chaitanya.kulkarni@xxxxxxx, martin.petersen@xxxxxxxxxx, viro@xxxxxxxxxxxxxxxxxx, tytso@xxxxxxx, jaegeuk@xxxxxxxxxx, ebiggers@xxxxxxxxxx, djwong@xxxxxxxxxx, shaggy@xxxxxxxxxx, konishi.ryusuke@xxxxxxxxx, mark@xxxxxxxxxx, jlbec@xxxxxxxxxxxx, joseph.qi@xxxxxxxxxxxxxxxxx, damien.lemoal@xxxxxxx, naohiro.aota@xxxxxxx, jth@xxxxxxxxxx, rjw@xxxxxxxxxxxxx, len.brown@xxxxxxxxx, pavel@xxxxxx, akpm@xxxxxxxxxxxxxxxxxxxx, hare@xxxxxxx, gustavoars@xxxxxxxxxx, tiwai@xxxxxxx, alex.shi@xxxxxxxxxxxxxxxxx, asml.silence@xxxxxxxxx, ming.lei@xxxxxxxxxx, tj@xxxxxxxxxx, osandov@xxxxxx, bvanassche@xxxxxxx, jefflexu@xxxxxxxxxxxxxxxxx
- Delivery-date: Thu, 28 Jan 2021 07:13:43 +0000
- Ironport-sdr: 9tB28j1q+nnIPuDB5wePPnLsv+Mo5WRek8Uh+zU5su/oJexnaAaYu9yPRqaho091YftwlpUJBE PhX3rQffvkggnbazPvdbC5aZXrUJ9S/WG8zbB/hC8pka+zkamLggTJ9gcgMB5qVM7byIp5uUmq AV72Hii6/Ui/705IHx5ZpKWsbcumeu3J/exRk4/yPggJGQE9Le6tDjfAAy5ssecXCn+T+6pyVG TzzfTaxKw4oYrKb8ZwUCxT8YmZ3SK4zk1jie//PSY05+/j626pRwX1fxsoZ0fYyF+DujVimOrj j2s=
- Ironport-sdr: fmFECU/ozojdAGO4TaFB94S6o/akCQP5Na+pHyxekpThs8wHDa8O2Ehtmi0q7ax0Igbtiu0Shv nE/wwFwlPEksS13Rys+8U5cq8zVV5nlEkhVhIvYArOA9IVZ/2JwX6yjmECTimHfDVRAp/5Ehgi +QoVQbFDbkMq1PIsbaFhPwknOvaTq8yVEhifj8Re8s2LfMiLd2XTIohDt387FZP1fY+9ywMFbs yo7QaRE7MYJ8czE4PCNOYkpFvU3PMlN+24Sx17iDATDVngu8lqKN/8D9Sn46Wu6Z3sGmIxNPG/ vesTxhe1MXqN0GNI+/HLzYtH
- Ironport-sdr: Soam0z/hZs1yuoqW7i6jx5roOoHAapZwcG8+RboeMSicIzBmOYiX0n71yThGE0I1AnlhuM1di0 VAe/ab59Zj3d54HqeQwwCvYowNBZyfmch3v7Oy4azaqst0BpJQIg4rXG9R5IU/X7180i4BamQI Pdm6cEOWuqZT053sZGwqRvhtwriLsaGVJTX83nQ+r2PwZZdfIXxXkXEJoScfk1suUPevohY8gp ghp78Zzi9GkjGDnNvz6HqiAkBvVb/9awaEDn2T+13/9ul6gQjwyqb4x2IkJNU2l4rR1clxPnay 0k0=
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Wdcironportexception: Internal
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
---
fs/block_dev.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 9d4b1a884d76..f3e3247894d7 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -367,6 +367,8 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter
*iter, int nr_pages)
return -EINVAL;
bio = bio_alloc_bioset(GFP_KERNEL, nr_pages, &blkdev_dio_pool);
+ bio_set_dev(bio, bdev);
+ bio->bi_iter.bi_sector = pos >> 9;
dio = container_of(bio, struct blkdev_dio, bio);
dio->is_sync = is_sync = is_sync_kiocb(iocb);
@@ -389,8 +391,6 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter
*iter, int nr_pages)
blk_start_plug(&plug);
for (;;) {
- bio_set_dev(bio, bdev);
- bio->bi_iter.bi_sector = pos >> 9;
bio->bi_write_hint = iocb->ki_hint;
bio->bi_private = dio;
bio->bi_end_io = blkdev_bio_end_io;
@@ -446,7 +446,7 @@ __blkdev_direct_IO(struct kiocb *iocb, struct iov_iter
*iter, int nr_pages)
}
submit_bio(bio);
- bio = bio_alloc(GFP_KERNEL, nr_pages);
+ bio = bio_new(bdev, pos >> 9, 0, 0, nr_pages, GFP_KERNEL);
}
if (!is_poll)
--
2.22.1
|