[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6e86fe6e-fcbb-908c-11a4-4c322199bc5e@fujitsu.com>
Date: Fri, 27 Aug 2021 13:26:41 +0800
From: Shiyang Ruan <ruansy.fnst@...itsu.com>
To: Dan Williams <dan.j.williams@...el.com>
CC: Christoph Hellwig <hch@....de>,
"Darrick J. Wong" <djwong@...nel.org>,
linux-xfs <linux-xfs@...r.kernel.org>,
david <david@...morbit.com>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux NVDIMM <nvdimm@...ts.linux.dev>,
Goldwyn Rodrigues <rgoldwyn@...e.de>,
Al Viro <viro@...iv.linux.org.uk>,
Matthew Wilcox <willy@...radead.org>,
Goldwyn Rodrigues <rgoldwyn@...e.com>,
Ritesh Harjani <riteshh@...ux.ibm.com>
Subject: Re: [PATCH v7 3/8] fsdax: Replace mmap entry in case of CoW
On 2021/8/27 13:00, Dan Williams wrote:
> On Thu, Aug 26, 2021 at 8:22 PM Shiyang Ruan <ruansy.fnst@...itsu.com> wrote:
>>
>>
>>
>> On 2021/8/23 20:57, Christoph Hellwig wrote:
>>> On Thu, Aug 19, 2021 at 03:54:01PM -0700, Dan Williams wrote:
>>>>
>>>> static void *dax_insert_entry(struct xa_state *xas, struct vm_fault *vmf,
>>>> const struct iomap_iter *iter, void
>>>> *entry, pfn_t pfn,
>>>> unsigned long flags)
>>>>
>>>>
>>>>> {
>>>>> + struct address_space *mapping = vmf->vma->vm_file->f_mapping;
>>>>> void *new_entry = dax_make_entry(pfn, flags);
>>>>> + bool dirty = insert_flags & DAX_IF_DIRTY;
>>>>> + bool cow = insert_flags & DAX_IF_COW;
>>>>
>>>> ...and then calculate these flags from the source data. I'm just
>>>> reacting to "yet more flags".
>>>
>>> Except for the overly long line above that seems like a good idea.
>>> The iomap_iter didn't exist for most of the time this patch has been
>>> around.
>>>
>>
>> So should I reuse the iter->flags to pass the insert_flags? (left shift
>> it to higher bits)
>
> No, the advice is to just pass the @iter to dax_insert_entry directly
> and calculate @dirty and @cow internally.
>
I see. Yes, they can be calculated inside the dax_insert_entry()
because it already has enough arguments.
--
Thanks,
Ruan.
Powered by blists - more mailing lists