All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Linux FS-devel Mailing List <linux-fsdevel@vger.kernel.org>,
	Parisc List <linux-parisc@vger.kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	linux-nvdimm@lists.01.org
Subject: PATCH] fs/dax: fix compile problem on parisc and mips
Date: Thu, 03 Dec 2020 16:33:10 -0800	[thread overview]
Message-ID: <fb91b40d258414b0fdce2c380752e48daa6a70d6.camel@HansenPartnership.com> (raw)

These platforms define PMD_ORDER in asm/pgtable.h

This means that as soon as dax.c included asm/pgtable.h in commit
11cf9d863dcb ("fs/dax: Deposit pagetable even when installing zero
page") we clash with PMD_ORDER introduced by cfc93c6c6c96 ("dax:
Convert dax_insert_pfn_mkwrite to XArray") and we get this problem:

/home/jejb/git/linux-build/fs/dax.c:53: warning: "PMD_ORDER" redefined
   53 | #define PMD_ORDER (PMD_SHIFT - PAGE_SHIFT)
      |
In file included from /home/jejb/git/linux-build/include/linux/pgtable.h:6,
                 from /home/jejb/git/linux-build/include/linux/mm.h:33,
                 from /home/jejb/git/linux-build/include/linux/bvec.h:14,
                 from /home/jejb/git/linux-build/include/linux/blk_types.h:10,
                 from /home/jejb/git/linux-build/include/linux/genhd.h:19,
                 from /home/jejb/git/linux-build/include/linux/blkdev.h:8,
                 from /home/jejb/git/linux-build/fs/dax.c:10:
/home/jejb/git/linux-build/arch/parisc/include/asm/pgtable.h:124: note: this is the location of the previous definition
  124 | #define PMD_ORDER 1 /* Number of pages per pmd */
      |
make[2]: *** Deleting file 'fs/dax.o'

Fix by renaming dax's PMD_ORDER to DAX_PMD_ORDER

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
---
 fs/dax.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/dax.c b/fs/dax.c
index 5b47834f2e1b..4d3b0db5c321 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -50,7 +50,7 @@ static inline unsigned int pe_order(enum page_entry_size pe_size)
 #define PG_PMD_NR	(PMD_SIZE >> PAGE_SHIFT)
 
 /* The order of a PMD entry */
-#define PMD_ORDER	(PMD_SHIFT - PAGE_SHIFT)
+#define DAX_PMD_ORDER	(PMD_SHIFT - PAGE_SHIFT)
 
 static wait_queue_head_t wait_table[DAX_WAIT_TABLE_ENTRIES];
 
@@ -98,7 +98,7 @@ static bool dax_is_locked(void *entry)
 static unsigned int dax_entry_order(void *entry)
 {
 	if (xa_to_value(entry) & DAX_PMD)
-		return PMD_ORDER;
+		return DAX_PMD_ORDER;
 	return 0;
 }
 
@@ -1471,7 +1471,7 @@ static vm_fault_t dax_iomap_pmd_fault(struct vm_fault *vmf, pfn_t *pfnp,
 {
 	struct vm_area_struct *vma = vmf->vma;
 	struct address_space *mapping = vma->vm_file->f_mapping;
-	XA_STATE_ORDER(xas, &mapping->i_pages, vmf->pgoff, PMD_ORDER);
+	XA_STATE_ORDER(xas, &mapping->i_pages, vmf->pgoff, DAX_PMD_ORDER);
 	unsigned long pmd_addr = vmf->address & PMD_MASK;
 	bool write = vmf->flags & FAULT_FLAG_WRITE;
 	bool sync;
@@ -1530,7 +1530,7 @@ static vm_fault_t dax_iomap_pmd_fault(struct vm_fault *vmf, pfn_t *pfnp,
 	 * entry is already in the array, for instance), it will return
 	 * VM_FAULT_FALLBACK.
 	 */
-	entry = grab_mapping_entry(&xas, mapping, PMD_ORDER);
+	entry = grab_mapping_entry(&xas, mapping, DAX_PMD_ORDER);
 	if (xa_is_internal(entry)) {
 		result = xa_to_internal(entry);
 		goto fallback;
@@ -1696,7 +1696,7 @@ dax_insert_pfn_mkwrite(struct vm_fault *vmf, pfn_t pfn, unsigned int order)
 	if (order == 0)
 		ret = vmf_insert_mixed_mkwrite(vmf->vma, vmf->address, pfn);
 #ifdef CONFIG_FS_DAX_PMD
-	else if (order == PMD_ORDER)
+	else if (order == DAX_PMD_ORDER)
 		ret = vmf_insert_pfn_pmd(vmf, pfn, FAULT_FLAG_WRITE);
 #endif
 	else
-- 
2.29.2

_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

WARNING: multiple messages have this Message-ID (diff)
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Linux FS-devel Mailing List <linux-fsdevel@vger.kernel.org>,
	Parisc List <linux-parisc@vger.kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.ibm.com>,
	linux-nvdimm@lists.01.org
Subject: PATCH] fs/dax: fix compile problem on parisc and mips
Date: Thu, 03 Dec 2020 16:33:10 -0800	[thread overview]
Message-ID: <fb91b40d258414b0fdce2c380752e48daa6a70d6.camel@HansenPartnership.com> (raw)

These platforms define PMD_ORDER in asm/pgtable.h

This means that as soon as dax.c included asm/pgtable.h in commit
11cf9d863dcb ("fs/dax: Deposit pagetable even when installing zero
page") we clash with PMD_ORDER introduced by cfc93c6c6c96 ("dax:
Convert dax_insert_pfn_mkwrite to XArray") and we get this problem:

/home/jejb/git/linux-build/fs/dax.c:53: warning: "PMD_ORDER" redefined
   53 | #define PMD_ORDER (PMD_SHIFT - PAGE_SHIFT)
      |
In file included from /home/jejb/git/linux-build/include/linux/pgtable.h:6,
                 from /home/jejb/git/linux-build/include/linux/mm.h:33,
                 from /home/jejb/git/linux-build/include/linux/bvec.h:14,
                 from /home/jejb/git/linux-build/include/linux/blk_types.h:10,
                 from /home/jejb/git/linux-build/include/linux/genhd.h:19,
                 from /home/jejb/git/linux-build/include/linux/blkdev.h:8,
                 from /home/jejb/git/linux-build/fs/dax.c:10:
/home/jejb/git/linux-build/arch/parisc/include/asm/pgtable.h:124: note: this is the location of the previous definition
  124 | #define PMD_ORDER 1 /* Number of pages per pmd */
      |
make[2]: *** Deleting file 'fs/dax.o'

Fix by renaming dax's PMD_ORDER to DAX_PMD_ORDER

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
---
 fs/dax.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/dax.c b/fs/dax.c
index 5b47834f2e1b..4d3b0db5c321 100644
--- a/fs/dax.c
+++ b/fs/dax.c
@@ -50,7 +50,7 @@ static inline unsigned int pe_order(enum page_entry_size pe_size)
 #define PG_PMD_NR	(PMD_SIZE >> PAGE_SHIFT)
 
 /* The order of a PMD entry */
-#define PMD_ORDER	(PMD_SHIFT - PAGE_SHIFT)
+#define DAX_PMD_ORDER	(PMD_SHIFT - PAGE_SHIFT)
 
 static wait_queue_head_t wait_table[DAX_WAIT_TABLE_ENTRIES];
 
@@ -98,7 +98,7 @@ static bool dax_is_locked(void *entry)
 static unsigned int dax_entry_order(void *entry)
 {
 	if (xa_to_value(entry) & DAX_PMD)
-		return PMD_ORDER;
+		return DAX_PMD_ORDER;
 	return 0;
 }
 
@@ -1471,7 +1471,7 @@ static vm_fault_t dax_iomap_pmd_fault(struct vm_fault *vmf, pfn_t *pfnp,
 {
 	struct vm_area_struct *vma = vmf->vma;
 	struct address_space *mapping = vma->vm_file->f_mapping;
-	XA_STATE_ORDER(xas, &mapping->i_pages, vmf->pgoff, PMD_ORDER);
+	XA_STATE_ORDER(xas, &mapping->i_pages, vmf->pgoff, DAX_PMD_ORDER);
 	unsigned long pmd_addr = vmf->address & PMD_MASK;
 	bool write = vmf->flags & FAULT_FLAG_WRITE;
 	bool sync;
@@ -1530,7 +1530,7 @@ static vm_fault_t dax_iomap_pmd_fault(struct vm_fault *vmf, pfn_t *pfnp,
 	 * entry is already in the array, for instance), it will return
 	 * VM_FAULT_FALLBACK.
 	 */
-	entry = grab_mapping_entry(&xas, mapping, PMD_ORDER);
+	entry = grab_mapping_entry(&xas, mapping, DAX_PMD_ORDER);
 	if (xa_is_internal(entry)) {
 		result = xa_to_internal(entry);
 		goto fallback;
@@ -1696,7 +1696,7 @@ dax_insert_pfn_mkwrite(struct vm_fault *vmf, pfn_t pfn, unsigned int order)
 	if (order == 0)
 		ret = vmf_insert_mixed_mkwrite(vmf->vma, vmf->address, pfn);
 #ifdef CONFIG_FS_DAX_PMD
-	else if (order == PMD_ORDER)
+	else if (order == DAX_PMD_ORDER)
 		ret = vmf_insert_pfn_pmd(vmf, pfn, FAULT_FLAG_WRITE);
 #endif
 	else
-- 
2.29.2



             reply	other threads:[~2020-12-04  0:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04  0:33 James Bottomley [this message]
2020-12-04  0:33 ` PATCH] fs/dax: fix compile problem on parisc and mips James Bottomley
2020-12-04  3:48 ` Matthew Wilcox
2020-12-04  3:48   ` Matthew Wilcox
2020-12-04  7:57   ` Helge Deller
2020-12-04  7:57     ` Helge Deller
2020-12-04 12:44     ` Matthew Wilcox
2020-12-04 12:44       ` Matthew Wilcox
2020-12-04 13:28       ` John David Anglin
2020-12-04 13:28         ` John David Anglin
2020-12-04 14:11         ` Matthew Wilcox
2020-12-04 14:11           ` Matthew Wilcox
2021-01-28 19:18 ` Helge Deller

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=fb91b40d258414b0fdce2c380752e48daa6a70d6.camel@HansenPartnership.com \
    --to=james.bottomley@hansenpartnership.com \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-nvdimm@lists.01.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=willy@infradead.org \
    /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.