[dm-devel] [PATCH v3 3/7] dax, pmem: Add a dax operation zero_page_range
Christoph Hellwig
hch at infradead.org
Mon Feb 17 13:26:07 UTC 2020
> + int rc;
> + struct pmem_device *pmem = dax_get_private(dax_dev);
> + struct page *page = ZERO_PAGE(0);
Nit: I tend to find code easier to read if variable declarations
with assignments are above those without.
Also I don't think we need the page variable here.
> + rc = pmem_do_write(pmem, page, 0, offset, len);
> + if (rc > 0)
> + return -EIO;
pmem_do_write returns a blk_status_t, so the type of rc and the > check
seem odd. But I think pmem_do_write (and pmem_do_read) might be better
off returning a normal errno anyway.
More information about the dm-devel
mailing list