[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BL0PR04MB651467E7A7C6EA542A435DC6E7BA9@BL0PR04MB6514.namprd04.prod.outlook.com>
Date: Thu, 28 Jan 2021 07:25:08 +0000
From: Damien Le Moal <Damien.LeMoal@....com>
To: Chaitanya Kulkarni <Chaitanya.Kulkarni@....com>,
"linux-xfs@...r.kernel.org" <linux-xfs@...r.kernel.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
"dm-devel@...hat.com" <dm-devel@...hat.com>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"drbd-dev@...ts.linbit.com" <drbd-dev@...ts.linbit.com>,
"xen-devel@...ts.xenproject.org" <xen-devel@...ts.xenproject.org>,
"linux-nvme@...ts.infradead.org" <linux-nvme@...ts.infradead.org>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"target-devel@...r.kernel.org" <target-devel@...r.kernel.org>,
"linux-fscrypt@...r.kernel.org" <linux-fscrypt@...r.kernel.org>,
"jfs-discussion@...ts.sourceforge.net"
<jfs-discussion@...ts.sourceforge.net>,
"linux-nilfs@...r.kernel.org" <linux-nilfs@...r.kernel.org>,
"ocfs2-devel@....oracle.com" <ocfs2-devel@....oracle.com>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>
CC: "axboe@...nel.dk" <axboe@...nel.dk>,
"philipp.reisner@...bit.com" <philipp.reisner@...bit.com>,
"lars.ellenberg@...bit.com" <lars.ellenberg@...bit.com>,
"konrad.wilk@...cle.com" <konrad.wilk@...cle.com>,
"roger.pau@...rix.com" <roger.pau@...rix.com>,
"minchan@...nel.org" <minchan@...nel.org>,
"ngupta@...are.org" <ngupta@...are.org>,
"sergey.senozhatsky.work@...il.com"
<sergey.senozhatsky.work@...il.com>,
"agk@...hat.com" <agk@...hat.com>,
"snitzer@...hat.com" <snitzer@...hat.com>,
"hch@....de" <hch@....de>, "sagi@...mberg.me" <sagi@...mberg.me>,
"martin.petersen@...cle.com" <martin.petersen@...cle.com>,
"viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
"tytso@....edu" <tytso@....edu>,
"jaegeuk@...nel.org" <jaegeuk@...nel.org>,
"ebiggers@...nel.org" <ebiggers@...nel.org>,
"djwong@...nel.org" <djwong@...nel.org>,
"shaggy@...nel.org" <shaggy@...nel.org>,
"konishi.ryusuke@...il.com" <konishi.ryusuke@...il.com>,
"mark@...heh.com" <mark@...heh.com>,
"jlbec@...lplan.org" <jlbec@...lplan.org>,
"joseph.qi@...ux.alibaba.com" <joseph.qi@...ux.alibaba.com>,
Naohiro Aota <Naohiro.Aota@....com>,
"jth@...nel.org" <jth@...nel.org>,
"rjw@...ysocki.net" <rjw@...ysocki.net>,
"len.brown@...el.com" <len.brown@...el.com>,
"pavel@....cz" <pavel@....cz>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"hare@...e.de" <hare@...e.de>,
"gustavoars@...nel.org" <gustavoars@...nel.org>,
"tiwai@...e.de" <tiwai@...e.de>,
"alex.shi@...ux.alibaba.com" <alex.shi@...ux.alibaba.com>,
"asml.silence@...il.com" <asml.silence@...il.com>,
"ming.lei@...hat.com" <ming.lei@...hat.com>,
"tj@...nel.org" <tj@...nel.org>, "osandov@...com" <osandov@...com>,
"bvanassche@....org" <bvanassche@....org>,
"jefflexu@...ux.alibaba.com" <jefflexu@...ux.alibaba.com>
Subject: Re: [RFC PATCH 28/34] zonefs: use bio_new
On 2021/01/28 16:15, Chaitanya Kulkarni wrote:
> Signed-off-by: Chaitanya Kulkarni <chaitanya.kulkarni@....com>
> ---
> fs/zonefs/super.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
> index ab68e27bb322..620d67965a22 100644
> --- a/fs/zonefs/super.c
> +++ b/fs/zonefs/super.c
> @@ -661,6 +661,7 @@ static const struct iomap_dio_ops zonefs_write_dio_ops = {
>
> static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from)
> {
> + unsigned int op = REQ_OP_ZONE_APPEND | REQ_SYNC | REQ_IDLE;
I do not see the point of adding this variable since it is used only for the
bio_new() call. Pass the op value directly.
> struct inode *inode = file_inode(iocb->ki_filp);
> struct zonefs_inode_info *zi = ZONEFS_I(inode);
> struct block_device *bdev = inode->i_sb->s_bdev;
> @@ -678,15 +679,12 @@ static ssize_t zonefs_file_dio_append(struct kiocb *iocb, struct iov_iter *from)
> if (!nr_pages)
> return 0;
>
> - bio = bio_alloc(GFP_NOFS, nr_pages);
> + bio = bio_new(bdev, zi->i_zsector, op, 0, GFP_NOFS, nr_pages);
> if (!bio)
> return -ENOMEM;
>
> - bio_set_dev(bio, bdev);
> - bio->bi_iter.bi_sector = zi->i_zsector;
> bio->bi_write_hint = iocb->ki_hint;
> bio->bi_ioprio = iocb->ki_ioprio;
> - bio->bi_opf = REQ_OP_ZONE_APPEND | REQ_SYNC | REQ_IDLE;
> if (iocb->ki_flags & IOCB_DSYNC)
> bio->bi_opf |= REQ_FUA;
>
>
--
Damien Le Moal
Western Digital Research
Powered by blists - more mailing lists