[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4ed8baf7-7eb9-71e5-58ea-7c73b7e5bb73@fujitsu.com>
Date: Wed, 30 Mar 2022 18:58:21 +0800
From: Shiyang Ruan <ruansy.fnst@...itsu.com>
To: Christoph Hellwig <hch@...radead.org>
CC: Dan Williams <dan.j.williams@...el.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-xfs <linux-xfs@...r.kernel.org>,
Linux NVDIMM <nvdimm@...ts.linux.dev>,
Linux MM <linux-mm@...ck.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
"Darrick J. Wong" <djwong@...nel.org>, david <david@...morbit.com>,
Jane Chu <jane.chu@...cle.com>
Subject: Re: [PATCH v11 1/8] dax: Introduce holder for dax_device
在 2022/3/30 18:13, Christoph Hellwig 写道:
> On Wed, Mar 30, 2022 at 06:03:01PM +0800, Shiyang Ruan wrote:
>>
>> Because I am not sure if the offset between each layer is page aligned. For
>> example, when pmem dirver handles ->memory_failure(), it should subtract its
>> ->data_offset when it calls dax_holder_notify_failure().
>
> If they aren't, none of the DAX machinery would work.
OK. Got it.
So, use page-based function signature for ->memory_failure():
int (*memory_failure)(struct dev_pagemap *pgmap, unsigned long pfn,
unsigned long nr_pfns, int flags);
As the code I pasted before, pmem driver will subtract its
->data_offset, which is byte-based. And the filesystem who implements
->notify_failure() will calculate the offset in unit of byte again.
So, leave its function signature byte-based, to avoid repeated conversions.
int (*notify_failure)(struct dax_device *dax_dev, u64 offset,
u64 len, int mf_flags);
What do you think?
--
Thanks,
Ruan.
Powered by blists - more mailing lists