[RFC PATCH 13/34] block: use bio_new in __blkdev_direct_IO
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: linux-xfs@xxxxxxxxxxxxxxx, linux-fsdevel@xxxxxxxxxxxxxxx, dm-devel@xxxxxxxxxx, linux-block@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, drbd-dev@xxxxxxxxxxxxxxx, 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
- Subject: [RFC PATCH 13/34] block: use bio_new in __blkdev_direct_IO
- From: Chaitanya Kulkarni <chaitanya.kulkarni@xxxxxxx>
- Date: Wed, 27 Jan 2021 23:11:12 -0800
- In-reply-to: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com>
- Ironport-sdr: LfJ4JLhhHVdXp1cvPJTo1ftvY2DeWF83ozPRFqNsH1a5jtHBlAgv0BqBcUD9tGuhIzxkVlcp5o IEWe3De0To4AS/w04q8p7ul0vqMoZ6fJEEp6945RQCLu62xgvmnYhMx7uCc4OGp5I8I3Hp1Rlp qVUz+xFVuEpdrlkGwHeDvEtkuXKCUT42pyihz3gNE7mhEjdgDFZ3xo+j9H8QMujAbfRPjIpbiw th9+yUJxVvJXnfPn7+IWWIVqISObNxswk8x4RnpL96Z5TGHRQrrfiqStRohgEXgQ2h8WfEFgDz 66w=
- Ironport-sdr: sGvKLNi8TvX47sSSbUOvwspM2nmzABkQ/LMatD0iblYu9ZRp5SWSOEy6z06BlkO94Hu5j0I8vf IkiWOXAWC17odUxUvWIbfrY4RblOI3HPVrgnPS3RfIQWtvtEPcAZG0uwObmdI0MiYFdJXcMMNn d+qBGDS5ohmmL7gE346406blFx2QT75mI0js34CJBFtqhKtRu+pcGj0+IlD3JkOU596X+VFI9n EIcaJzh8DEAO8EY2X1VGGI1wLc61OnmVAxF+DKng4UWX6401Gl3sBlTV50ya66yqdiBMj19do6 6E59cdT515MRqNZXW+fl+hp9
- Ironport-sdr: Soam0z/hZs1yuoqW7i6jx5roOoHAapZwcG8+RboeMSicIzBmOYiX0n71yThGE0I1AnlhuM1di0 VAe/ab59Zj3d54HqeQwwCvYowNBZyfmch3v7Oy4azaqst0BpJQIg4rXG9R5IU/X7180i4BamQI Pdm6cEOWuqZT053sZGwqRvhtwriLsaGVJTX83nQ+r2PwZZdfIXxXkXEJoScfk1suUPevohY8gp ghp78Zzi9GkjGDnNvz6HqiAkBvVb/9awaEDn2T+13/9ul6gQjwyqb4x2IkJNU2l4rR1clxPnay 0k0=
- References: <20210128071133.60335-1-chaitanya.kulkarni@wdc.com>
- 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
[Index of Archives]
[linux Cryptography]
[Asterisk App Development]
[PJ SIP]
[Gnu Gatekeeper]
[IETF Sipping]
[Info Cyrus]
[ALSA User]
[Fedora Linux Users]
[Linux SCTP]
[DCCP]
[Gimp]
[Yosemite News]
[Deep Creek Hot Springs]
[Yosemite Campsites]
[ISDN Cause Codes]