[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210128071133.60335-32-chaitanya.kulkarni@wdc.com>
Date: Wed, 27 Jan 2021 23:11:30 -0800
From: Chaitanya Kulkarni <chaitanya.kulkarni@....com>
To: linux-xfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
dm-devel@...hat.com, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, drbd-dev@...ts.linbit.com,
xen-devel@...ts.xenproject.org, linux-nvme@...ts.infradead.org,
linux-scsi@...r.kernel.org, target-devel@...r.kernel.org,
linux-fscrypt@...r.kernel.org,
jfs-discussion@...ts.sourceforge.net, linux-nilfs@...r.kernel.org,
ocfs2-devel@....oracle.com, linux-pm@...r.kernel.org,
linux-mm@...ck.org
Cc: axboe@...nel.dk, philipp.reisner@...bit.com,
lars.ellenberg@...bit.com, konrad.wilk@...cle.com,
roger.pau@...rix.com, minchan@...nel.org, ngupta@...are.org,
sergey.senozhatsky.work@...il.com, agk@...hat.com,
snitzer@...hat.com, hch@....de, sagi@...mberg.me,
chaitanya.kulkarni@....com, martin.petersen@...cle.com,
viro@...iv.linux.org.uk, tytso@....edu, jaegeuk@...nel.org,
ebiggers@...nel.org, djwong@...nel.org, shaggy@...nel.org,
konishi.ryusuke@...il.com, mark@...heh.com, jlbec@...lplan.org,
joseph.qi@...ux.alibaba.com, damien.lemoal@....com,
naohiro.aota@....com, jth@...nel.org, rjw@...ysocki.net,
len.brown@...el.com, pavel@....cz, akpm@...ux-foundation.org,
hare@...e.de, gustavoars@...nel.org, tiwai@...e.de,
alex.shi@...ux.alibaba.com, asml.silence@...il.com,
ming.lei@...hat.com, tj@...nel.org, osandov@...com,
bvanassche@....org, jefflexu@...ux.alibaba.com
Subject: [RFC PATCH 31/34] iomap: use bio_new in iomap_readpage_actor
Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@....com>
---
fs/iomap/buffered-io.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/fs/iomap/buffered-io.c b/fs/iomap/buffered-io.c
index 16a1e82e3aeb..08d119b62cf5 100644
--- a/fs/iomap/buffered-io.c
+++ b/fs/iomap/buffered-io.c
@@ -241,6 +241,9 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
struct page *page = ctx->cur_page;
struct iomap_page *iop = iomap_page_create(inode, page);
bool same_page = false, is_contig = false;
+ struct block_device *bdev = iomap->bdev;
+ unsigned opf = ctx->rac ? REQ_RAHEAD : 0;
+ unsigned op = REQ_OP_READ;
loff_t orig_pos = pos;
unsigned poff, plen;
sector_t sector;
@@ -285,19 +288,14 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, loff_t length, void *data,
if (ctx->rac) /* same as readahead_gfp_mask */
gfp |= __GFP_NORETRY | __GFP_NOWARN;
- ctx->bio = bio_alloc(gfp, min(BIO_MAX_PAGES, nr_vecs));
+ ctx->bio = bio_new(bdev, sector, op, opf, gfp, nr_vecs);
/*
* If the bio_alloc fails, try it again for a single page to
* avoid having to deal with partial page reads. This emulates
* what do_mpage_readpage does.
*/
if (!ctx->bio)
- ctx->bio = bio_alloc(orig_gfp, 1);
- ctx->bio->bi_opf = REQ_OP_READ;
- if (ctx->rac)
- ctx->bio->bi_opf |= REQ_RAHEAD;
- ctx->bio->bi_iter.bi_sector = sector;
- bio_set_dev(ctx->bio, iomap->bdev);
+ ctx->bio = bio_new(bdev, sector, op, opf, orig_gfp, 1);
ctx->bio->bi_end_io = iomap_read_end_io;
}
--
2.22.1
Powered by blists - more mailing lists