[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <171156dd-34fb-1c49-7c75-3b6bb5dc5717@oracle.com>
Date: Thu, 4 Nov 2021 20:27:53 +0000
From: Jane Chu <jane.chu@...cle.com>
To: Christoph Hellwig <hch@...radead.org>
CC: "dan.j.williams@...el.com" <dan.j.williams@...el.com>,
"vishal.l.verma@...el.com" <vishal.l.verma@...el.com>,
"dave.jiang@...el.com" <dave.jiang@...el.com>,
"ira.weiny@...el.com" <ira.weiny@...el.com>,
"viro@...iv.linux.org.uk" <viro@...iv.linux.org.uk>,
"willy@...radead.org" <willy@...radead.org>,
"jack@...e.cz" <jack@...e.cz>,
"nvdimm@...ts.linux.dev" <nvdimm@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>
Subject: Re: [PATCH 3/3] libnvdimm/pmem: Provide pmem_dax_clear_poison for dax
operation
On 11/4/2021 10:55 AM, Christoph Hellwig wrote:
> On Tue, Sep 14, 2021 at 05:31:32PM -0600, Jane Chu wrote:
>> +static int pmem_dax_clear_poison(struct dax_device *dax_dev, pgoff_t pgoff,
>> + size_t nr_pages)
>> +{
>> + unsigned int len = PFN_PHYS(nr_pages);
>> + sector_t sector = PFN_PHYS(pgoff) >> SECTOR_SHIFT;
>> + struct pmem_device *pmem = dax_get_private(dax_dev);
>> + phys_addr_t pmem_off = sector * 512 + pmem->data_offset;
>> + blk_status_t ret;
>> +
>> + if (!is_bad_pmem(&pmem->bb, sector, len))
>> + return 0;
>> +
>> + ret = pmem_clear_poison(pmem, pmem_off, len);
>> + return (ret == BLK_STS_OK) ? 0 : -EIO;
>
> No need for the braces here (and I'd prefer a good old if anyway).
>
> Otherwise looks good:
>
> Reviewed-by: Christoph Hellwig <hch@....de>
>
Thanks a lot! I'll keep in mind your comments.
-jane
Powered by blists - more mailing lists