All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Shiyang Ruan <ruansy.fnst@fujitsu.com>
Cc: <linux-kernel@vger.kernel.org>, <linux-xfs@vger.kernel.org>,
	<nvdimm@lists.linux.dev>, <linux-fsdevel@vger.kernel.org>,
	<djwong@kernel.org>, <david@fromorbit.com>,
	<dan.j.williams@intel.com>
Subject: Re: [PATCH v2.1 1/8] fsdax: introduce page->share for fsdax in reflink mode
Date: Fri, 2 Dec 2022 12:18:00 -0800	[thread overview]
Message-ID: <20221202121800.598afc7a5124561069f91014@linux-foundation.org> (raw)
In-Reply-To: <1669972991-246-1-git-send-email-ruansy.fnst@fujitsu.com>

On Fri, 2 Dec 2022 09:23:11 +0000 Shiyang Ruan <ruansy.fnst@fujitsu.com> wrote:

> fsdax page is used not only when CoW, but also mapread. To make the it
> easily understood, use 'share' to indicate that the dax page is shared
> by more than one extent.  And add helper functions to use it.
> 
> Also, the flag needs to be renamed to PAGE_MAPPING_DAX_SHARED.
> 

For those who are wondering what changed, I queued the below incremental
patch.


From: Shiyang Ruan <ruansy.fnst@fujitsu.com>
Subject: fsdax: introduce page->share for fsdax in reflink mode
Date: Fri, 2 Dec 2022 09:23:11 +0000

rename several functions

Link: https://lkml.kernel.org/r/1669972991-246-1-git-send-email-ruansy.fnst@fujitsu.com
Signed-off-by: Shiyang Ruan <ruansy.fnst@fujitsu.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Darrick J. Wong <djwong@kernel.org>
Cc: Dave Chinner <david@fromorbit.com>
Cc: Jason Gunthorpe <jgg@nvidia.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/dax.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

--- a/fs/dax.c~fsdax-introduce-page-share-for-fsdax-in-reflink-mode-fix
+++ a/fs/dax.c
@@ -334,7 +334,7 @@ static unsigned long dax_end_pfn(void *e
 	for (pfn = dax_to_pfn(entry); \
 			pfn < dax_end_pfn(entry); pfn++)
 
-static inline bool dax_mapping_is_shared(struct page *page)
+static inline bool dax_page_is_shared(struct page *page)
 {
 	return (unsigned long)page->mapping == PAGE_MAPPING_DAX_SHARED;
 }
@@ -343,7 +343,7 @@ static inline bool dax_mapping_is_shared
  * Set the page->mapping with PAGE_MAPPING_DAX_SHARED flag, increase the
  * refcount.
  */
-static inline void dax_mapping_set_shared(struct page *page)
+static inline void dax_page_bump_sharing(struct page *page)
 {
 	if ((uintptr_t)page->mapping != PAGE_MAPPING_DAX_SHARED) {
 		/*
@@ -357,7 +357,7 @@ static inline void dax_mapping_set_share
 	page->share++;
 }
 
-static inline unsigned long dax_mapping_decrease_shared(struct page *page)
+static inline unsigned long dax_page_drop_sharing(struct page *page)
 {
 	return --page->share;
 }
@@ -381,7 +381,7 @@ static void dax_associate_entry(void *en
 		struct page *page = pfn_to_page(pfn);
 
 		if (shared) {
-			dax_mapping_set_shared(page);
+			dax_page_bump_sharing(page);
 		} else {
 			WARN_ON_ONCE(page->mapping);
 			page->mapping = mapping;
@@ -402,9 +402,9 @@ static void dax_disassociate_entry(void
 		struct page *page = pfn_to_page(pfn);
 
 		WARN_ON_ONCE(trunc && page_ref_count(page) > 1);
-		if (dax_mapping_is_shared(page)) {
+		if (dax_page_is_shared(page)) {
 			/* keep the shared flag if this page is still shared */
-			if (dax_mapping_decrease_shared(page) > 0)
+			if (dax_page_drop_sharing(page) > 0)
 				continue;
 		} else
 			WARN_ON_ONCE(page->mapping && page->mapping != mapping);
_


  reply	other threads:[~2022-12-02 20:18 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-01 15:28 [PATCH v2 0/8] fsdax,xfs: fix warning messages Shiyang Ruan
2022-12-01 15:28 ` [PATCH v2 1/8] fsdax: introduce page->share for fsdax in reflink mode Shiyang Ruan
2022-12-01 16:14   ` Darrick J. Wong
2022-12-02  9:23   ` [PATCH v2.1 " Shiyang Ruan
2022-12-02 20:18     ` Andrew Morton [this message]
2022-12-03  0:19     ` Allison Henderson
2022-12-03  2:07     ` Dan Williams
2022-12-05  5:56       ` Shiyang Ruan
2022-12-05  7:01         ` Darrick J. Wong
2022-12-07  2:49   ` [PATCH v2.2 " Shiyang Ruan
2022-12-08  1:26     ` Darrick J. Wong
2022-12-01 15:28 ` [PATCH v2 2/8] fsdax: invalidate pages when CoW Shiyang Ruan
2022-12-01 16:17   ` Darrick J. Wong
2022-12-01 15:28 ` [PATCH v2 3/8] fsdax: zero the edges if source is HOLE or UNWRITTEN Shiyang Ruan
2022-12-01 23:58   ` Darrick J. Wong
2022-12-02  0:39     ` Andrew Morton
2022-12-02  9:25   ` [PATCH v2.1 " Shiyang Ruan
2022-12-03  0:19     ` Allison Henderson
2022-12-01 15:28 ` [PATCH v2 4/8] fsdax,xfs: set the shared flag when file extent is shared Shiyang Ruan
2022-12-02  0:05   ` Darrick J. Wong
2022-12-01 15:31 ` [PATCH v2 5/8] fsdax: dedupe: iter two files at the same time Shiyang Ruan
2022-12-02  0:05   ` Darrick J. Wong
2022-12-01 15:32 ` [PATCH v2 6/8] xfs: use dax ops for zero and truncate in fsdax mode Shiyang Ruan
2022-12-02  0:05   ` Darrick J. Wong
2022-12-01 15:32 ` [PATCH v2 7/8] fsdax,xfs: port unshare to fsdax Shiyang Ruan
2022-12-01 15:32 ` [PATCH v2 8/8] xfs: remove restrictions for fsdax and reflink Shiyang Ruan
2022-12-02  0:06   ` Darrick J. Wong
2022-12-03  1:21 ` [PATCH v2 0/8] fsdax,xfs: fix warning messages Dan Williams
2022-12-29  8:23   ` Shiyang Ruan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221202121800.598afc7a5124561069f91014@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dan.j.williams@intel.com \
    --cc=david@fromorbit.com \
    --cc=djwong@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-xfs@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=ruansy.fnst@fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.