[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221201012106.wrultudwilepwmnt@shindev>
Date: Thu, 1 Dec 2022 01:21:08 +0000
From: Shinichiro Kawasaki <shinichiro.kawasaki@....com>
To: Chaitanya Kulkarni <chaitanyak@...dia.com>
CC: "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"axboe@...nel.dk" <axboe@...nel.dk>,
"damien.lemoal@...nsource.wdc.com" <damien.lemoal@...nsource.wdc.com>,
"bvanassche@....org" <bvanassche@....org>,
"vincent.fu@...sung.com" <vincent.fu@...sung.com>
Subject: Re: [PATCH V4 1/8] null_blk: allow REQ_OP_WRITE_ZEROES
On Nov 30, 2022 / 23:29, Chaitanya Kulkarni wrote:
> >> Signed-off-by: Chaitanya Kulkarni <kch@...dia.com>
> >
> > This motivation sounds good. I tried this patch. With a quick test it looks
> > working good for me. Please find minor comments in line.
> >
> > [...]
> >
> >> +static void null_zero_sector(struct nullb_device *d, sector_t sect,
> >> + sector_t nr_sects, bool cache)
> >> +{
> >> + struct radix_tree_root *root = cache ? &d->cache : &d->data;
> >> + struct nullb_page *t_page;
> >> + unsigned int offset;
> >> + void *dest;
> >> +
> >> + t_page = radix_tree_lookup(root, sect >> PAGE_SECTORS_SHIFT);
> >> + if (!t_page)
> >> + return;
> >> +
> >> + offset = (sect & SECTOR_MASK) << SECTOR_SHIFT;
> >> + dest = kmap_atomic(t_page->page);
> >> + memset(dest + offset, 0, SECTOR_SIZE * nr_sects);
> >> + kunmap_atomic(dest);
> >> +}
> >
> > Did you consider to call null_lookup_page() for __null_lookup_page() from
> > null_zero_sector()? It may simplify this function a bit.
> >
>
> I found this clear and easy than going over call chain when
> debugging.
Okay, then the patch looks good to me :)
Reviewed-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@....com>
--
Shin'ichiro Kawasaki
Powered by blists - more mailing lists