Re: [PATCH v9 10/10] fsdax: set a CoW flag when associate reflink mappings

2022-01-21 Thread Shiyang Ruan
在 2022/1/21 15:16, Christoph Hellwig 写道: On Fri, Jan 21, 2022 at 10:33:58AM +0800, Shiyang Ruan wrote: But different question, how does this not conflict with: #define PAGE_MAPPING_ANON 0x1 in page-flags.h? Now we are treating dax pages, so I think its flags should be different

Re: [PATCH v9 10/10] fsdax: set a CoW flag when associate reflink mappings

2022-01-20 Thread Christoph Hellwig
On Fri, Jan 21, 2022 at 10:33:58AM +0800, Shiyang Ruan wrote: > > > > But different question, how does this not conflict with: > > > > #define PAGE_MAPPING_ANON 0x1 > > > > in page-flags.h? > > Now we are treating dax pages, so I think its flags should be different from > normal page.

Re: [PATCH v9 10/10] fsdax: set a CoW flag when associate reflink mappings

2022-01-20 Thread Shiyang Ruan
在 2022/1/20 16:59, Christoph Hellwig 写道: On Sun, Dec 26, 2021 at 10:34:39PM +0800, Shiyang Ruan wrote: +#define FS_DAX_MAPPING_COW 1UL + +#define MAPPING_SET_COW(m) (m = (struct address_space *)FS_DAX_MAPPING_COW) +#define MAPPING_TEST_COW(m)(((unsigned long)m &

Re: [PATCH v9 10/10] fsdax: set a CoW flag when associate reflink mappings

2022-01-20 Thread Christoph Hellwig
On Sun, Dec 26, 2021 at 10:34:39PM +0800, Shiyang Ruan wrote: > +#define FS_DAX_MAPPING_COW 1UL > + > +#define MAPPING_SET_COW(m) (m = (struct address_space *)FS_DAX_MAPPING_COW) > +#define MAPPING_TEST_COW(m) (((unsigned long)m & FS_DAX_MAPPING_COW) == \ > +

[PATCH v9 10/10] fsdax: set a CoW flag when associate reflink mappings

2021-12-26 Thread Shiyang Ruan
Introduce a FS_DAX_MAPPING_COW flag to support association with CoW file mappings. In this case, the dax-RMAP already takes the responsibility to look up for shared files by given dax page. The page->mapping is no longer to used for rmap but for marking that this dax page is shared. And to make