lkml.org 
[lkml]   [2022]   [Nov]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH V4 1/8] null_blk: allow REQ_OP_WRITE_ZEROES
Date
On Nov 30, 2022 / 23:29, Chaitanya Kulkarni wrote:
> >> Signed-off-by: Chaitanya Kulkarni <kch@nvidia.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@wdc.com>

--
Shin'ichiro Kawasaki
\
 
 \ /
  Last update: 2022-12-01 02:22    [W:0.073 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site