[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210128172402.GO7698@magnolia>
Date: Thu, 28 Jan 2021 09:24:02 -0800
From: "Darrick J. Wong" <djwong@...nel.org>
To: Chaitanya Kulkarni <chaitanya.kulkarni@....com>
Cc: 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, 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,
martin.petersen@...cle.com, viro@...iv.linux.org.uk, tytso@....edu,
jaegeuk@...nel.org, ebiggers@...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: Re: [RFC PATCH 18/34] iomap: use bio_new in iomap_dio_bio_actor
On Wed, Jan 27, 2021 at 11:11:17PM -0800, Chaitanya Kulkarni wrote:
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@....com>
> ---
> fs/iomap/direct-io.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/fs/iomap/direct-io.c b/fs/iomap/direct-io.c
> index f6c557a1bd25..0737192f7e5c 100644
> --- a/fs/iomap/direct-io.c
> +++ b/fs/iomap/direct-io.c
> @@ -267,9 +267,8 @@ iomap_dio_bio_actor(struct inode *inode, loff_t pos, loff_t length,
> goto out;
> }
>
> - bio = bio_alloc(GFP_KERNEL, nr_pages);
> - bio_set_dev(bio, iomap->bdev);
> - bio->bi_iter.bi_sector = iomap_sector(iomap, pos);
> + bio = bio_new(iomap->bdev, iomap_sector(iomap, pos), 0, 0,
> + nr_pages, GFP_KERNEL);
op == 0? It seems a little odd to me that we'd set the field to zero
and then construct bi_opf later.
It also strikes me as a little strange that bi_opf is combined from the
third and fourth parameters, but maybe some day you'll want to do some
parameter verification on debug kernels or something...?
--D
> bio->bi_write_hint = dio->iocb->ki_hint;
> bio->bi_ioprio = dio->iocb->ki_ioprio;
> bio->bi_private = dio;
> --
> 2.22.1
>
Powered by blists - more mailing lists