Shiyang Ruan 7a68003869 fsdax: set a CoW flag when associate reflink mappings
Introduce a PAGE_MAPPING_DAX_COW flag to support association with CoW file
mappings.  In this case, since the dax-rmap has already took 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 sure disassociation works fine, we use
page->index as refcount, and clear page->mapping to the initial state when
page->index is decreased to 0.

With the help of this new flag, it is able to distinguish normal case and
CoW case, and keep the warning in normal case.

Link: https://lkml.kernel.org/r/20220603053738.1218681-8-ruansy.fnst@fujitsu.com
Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Dan Williams <dan.j.wiliams@intel.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.com>
Cc: Goldwyn Rodrigues <rgoldwyn@suse.de>
Cc: Jane Chu <jane.chu@oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Miaohe Lin <linmiaohe@huawei.com>
Cc: Naoya Horiguchi <naoya.horiguchi@nec.com>
Cc: Ritesh Harjani <riteshh@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2022-06-27 13:45:21 -07:00
..
2022-06-17 06:03:30 +09:00
2022-05-09 16:21:44 -04:00
2022-06-21 11:47:30 -05:00
2022-05-09 16:21:45 -04:00
2022-05-09 16:21:45 -04:00
2022-05-02 11:23:49 -05:00
2022-06-27 13:45:19 -07:00
2022-06-27 13:45:19 -07:00
2022-06-03 10:34:34 -07:00
2022-05-27 15:49:30 -07:00
2022-05-09 16:21:45 -04:00
2022-05-24 19:55:07 -07:00
\n
2022-05-25 19:29:54 -07:00
2022-06-03 16:57:16 -07:00
2022-05-09 23:12:53 -04:00
2022-05-30 11:19:16 -07:00
2022-05-09 16:21:46 -04:00
2022-05-23 20:24:12 -05:00
2022-05-24 19:55:07 -07:00
2022-05-24 19:55:07 -07:00
2022-05-24 19:55:07 -07:00
2022-06-14 12:18:47 +02:00
2022-05-09 18:20:49 -07:00
2022-06-04 18:52:00 -07:00
2022-04-01 19:35:56 -07:00
2022-06-04 19:07:15 -07:00
2022-04-19 10:19:02 -07:00
2022-05-22 21:03:01 +01:00