Skip to contentSkip to conversation

fs/dax: include <asm/page.h> to fix build error on ARC

PATCH Superseded Randy Dunlap 5 participants 7 messages Jan 1, 2021 – Jan 5, 2021

Subsystems (4)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 fs/dax: include <asm/page.h> to fix build error on ARC

fs/dax.c uses copy_user_page() but ARC does not provide that interface, resulting in a build error.

Provide copy_user_page() in <asm/page.h> (beside copy_page()) and add <asm/page.h> to fs/dax.c to fix the build error.

../fs/dax.c: In function 'copy_cow_page_dax':
../fs/dax.c:702:2: error: implicit declaration of function 'copy_user_page'; did you mean 'copy_to_user_page'? [-Werror=implicit-function-declaration]

Fixes cccbce671582 ("filesystem-dax: convert to dax_direct_access()")
Cc Vineet Gupta <[email protected]>
Cc Dan Williams <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Jan Kara <[email protected]>

---
v2: rebase, add more Cc:

 arch/arc/include/asm/page.h |    1 +
 fs/dax.c                    |    1 +
 2 files changed, 2 insertions(+)
fs/dax.c +1 -0
@@ -25,6 +25,7 @@
 #include <linux/sizes.h>
 #include <linux/mmu_notifier.h>
 #include <linux/iomap.h>
+#include <asm/page.h>
 #include <asm/pgalloc.h>
 
 #define CREATE_TRACE_POINTS
arch/arc/include/asm/page.h +1 -0
@@ -10,6 +10,7 @@
 #ifndef __ASSEMBLY__
 
 #define clear_page(paddr)		memset((paddr), 0, PAGE_SIZE)
+#define copy_user_page(to, from, vaddr, pg)	copy_page(to, from)
 #define copy_page(to, from)		memcpy((to), (from), PAGE_SIZE)
 
 struct vm_area_struct;

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · Randy Dunlap

fs/dax.c uses copy_user_page() but ARC does not provide that interface, resulting in a build error.

Provide copy_user_page() in <asm/page.h> (beside copy_page()) and add <asm/page.h> to fs/dax.c to fix the build error.

Quoted 6 lines

../fs/dax.c: In function 'copy_cow_page_dax':
../fs/dax.c:702:2: error: implicit declaration of function 'copy_user_page'; did you mean 'copy_to_user_page'? [-Werror=implicit-function-declaration]

Fixes cccbce671582 ("filesystem-dax: convert to dax_direct_access()")

Looks reasonable

Quoted 36 lines

---
v2: rebase, add more Cc:

 arch/arc/include/asm/page.h |    1 +
 fs/dax.c                    |    1 +
 2 files changed, 2 insertions(+)
fs/dax.c +1 -0
@@ -25,6 +25,7 @@
 #include <linux/sizes.h>
 #include <linux/mmu_notifier.h>
 #include <linux/iomap.h>
+#include <asm/page.h>
 #include <asm/pgalloc.h>
 
 #define CREATE_TRACE_POINTS
arch/arc/include/asm/page.h +1 -0
@@ -10,6 +10,7 @@
 #ifndef __ASSEMBLY__
 
 #define clear_page(paddr)		memset((paddr), 0, PAGE_SIZE)
+#define copy_user_page(to, from, vaddr, pg)	copy_page(to, from)
 #define copy_page(to, from)		memcpy((to), (from), PAGE_SIZE)
 
 struct vm_area_struct;
Quoted 3 lines

_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]

_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]

#2 lore raw
In reply to Randy Dunlap
Quoted 32 lines · Randy Dunlap

fs/dax.c uses copy_user_page() but ARC does not provide that interface, resulting in a build error.

Provide copy_user_page() in <asm/page.h> (beside copy_page()) and add <asm/page.h> to fs/dax.c to fix the build error.

../fs/dax.c: In function 'copy_cow_page_dax':
../fs/dax.c:702:2: error: implicit declaration of function 'copy_user_page'; did you mean 'copy_to_user_page'? [-Werror=implicit-function-declaration]

Fixes cccbce671582 ("filesystem-dax: convert to dax_direct_access()")
Cc Vineet Gupta <[email protected]>
Cc Dan Williams <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Jan Kara <[email protected]>

---
v2: rebase, add more Cc:

 arch/arc/include/asm/page.h |    1 +
 fs/dax.c                    |    1 +
 2 files changed, 2 insertions(+)

fs/dax.c line 28

Quoted 4 lines
fs/dax.c +1 -0
@@ -25,6 +25,7 @@
 #include <linux/sizes.h>
 #include <linux/mmu_notifier.h>
 #include <linux/iomap.h>
+#include <asm/page.h>

I would expect this to come from one of the linux/ includes like linux/mm.h. asm/ headers are implementation linux/ headers are api.

Once you drop that then the subject of this patch can just be "arc:
add a copy_user_page() implementation", and handled by the arc maintainer (or I can take it with Vineet's ack).

fs/dax.c line 29

Quoted 1 line
fs/dax.c +0 -0
 #include <asm/pgalloc.h>

Yes, this one should have a linux/ api header to front it, but that's a cleanup for another day.

arch/arc/include/asm/page.h line 16

Quoted 12 lines
fs/dax.c +0 -0
 #define CREATE_TRACE_POINTS
arch/arc/include/asm/page.h +1 -0
@@ -10,6 +10,7 @@
 #ifndef __ASSEMBLY__
 
 #define clear_page(paddr)              memset((paddr), 0, PAGE_SIZE)
+#define copy_user_page(to, from, vaddr, pg)    copy_page(to, from)
 #define copy_page(to, from)            memcpy((to), (from), PAGE_SIZE)
 
 struct vm_area_struct;

_______________________________________________
Linux-nvdimm mailing list -- [email protected] To unsubscribe send an email to [email protected]

#3 lore raw
Quoted 10 lines · Dan Williams

fs/dax.c line 28

Quoted 6 lines · Randy Dunlap

+++ lnx-511-rc1/fs/dax.c

fs/dax.c +1 -0
@@ -25,6 +25,7 @@
 #include <linux/sizes.h>
 #include <linux/mmu_notifier.h>
 #include <linux/iomap.h>
+#include <asm/page.h>

I would expect this to come from one of the linux/ includes like linux/mm.h. asm/ headers are implementation linux/ headers are api.

It does indeed come from linux/mm.h already. And a number of other random places, including linux/serial.h. Our headers are a mess, but they shouldn't be made worse by adding _this_ include. So I second Dan's objection here.

Quoted 8 lines

Once you drop that then the subject of this patch can just be "arc:
add a copy_user_page() implementation", and handled by the arc maintainer (or I can take it with Vineet's ack).

fs/dax.c line 29

Quoted 1 line
fs/dax.c +0 -0
 #include <asm/pgalloc.h>

Yes, this one should have a linux/ api header to front it, but that's a cleanup for another day.

Definitely more involved.

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc

#4 lore raw
In reply to Dan Williams
Quoted 41 lines · Dan Williams
Quoted 32 lines · Randy Dunlap

fs/dax.c uses copy_user_page() but ARC does not provide that interface, resulting in a build error.

Provide copy_user_page() in <asm/page.h> (beside copy_page()) and add <asm/page.h> to fs/dax.c to fix the build error.

../fs/dax.c: In function 'copy_cow_page_dax':
../fs/dax.c:702:2: error: implicit declaration of function 'copy_user_page'; did you mean 'copy_to_user_page'? [-Werror=implicit-function-declaration]

Fixes cccbce671582 ("filesystem-dax: convert to dax_direct_access()")
Cc Vineet Gupta <[email protected]>
Cc Dan Williams <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Jan Kara <[email protected]>

---
v2: rebase, add more Cc:

 arch/arc/include/asm/page.h |    1 +
 fs/dax.c                    |    1 +
 2 files changed, 2 insertions(+)

fs/dax.c line 28

Quoted 4 lines
fs/dax.c +1 -0
@@ -25,6 +25,7 @@
 #include <linux/sizes.h>
 #include <linux/mmu_notifier.h>
 #include <linux/iomap.h>
+#include <asm/page.h>

I would expect this to come from one of the linux/ includes like linux/mm.h. asm/ headers are implementation linux/ headers are api.

Quoted 3 lines

Once you drop that then the subject of this patch can just be "arc:
add a copy_user_page() implementation", and handled by the arc maintainer (or I can take it with Vineet's ack).

Got it. Thanks.
Vineet is copied. I expect that he will take the v3 patch.

Quoted 4 lines

fs/dax.c line 29

Quoted 1 line
fs/dax.c +0 -0
 #include <asm/pgalloc.h>

Yes, this one should have a linux/ api header to front it, but that's a cleanup for another day.

That line is only part of the contextual diff in this patch. I guess you are just commenting in general, along with your earlier paragraph.

Quoted 12 lines
Quoted 12 lines
fs/dax.c +0 -0
 #define CREATE_TRACE_POINTS
arch/arc/include/asm/page.h +1 -0
@@ -10,6 +10,7 @@
 #ifndef __ASSEMBLY__
 
 #define clear_page(paddr)              memset((paddr), 0, PAGE_SIZE)
+#define copy_user_page(to, from, vaddr, pg)    copy_page(to, from)
 #define copy_page(to, from)            memcpy((to), (from), PAGE_SIZE)
 
 struct vm_area_struct;
Signature · 7 lines
~Randy


_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc
#5 lore raw
Quoted 50 lines · Randy Dunlap
Quoted 41 lines · Dan Williams
Quoted 32 lines · Randy Dunlap

fs/dax.c uses copy_user_page() but ARC does not provide that interface, resulting in a build error.

Provide copy_user_page() in <asm/page.h> (beside copy_page()) and add <asm/page.h> to fs/dax.c to fix the build error.

../fs/dax.c: In function 'copy_cow_page_dax':
../fs/dax.c:702:2: error: implicit declaration of function 'copy_user_page'; did you mean 'copy_to_user_page'? [-Werror=implicit-function-declaration]

Fixes cccbce671582 ("filesystem-dax: convert to dax_direct_access()")
Cc Vineet Gupta <[email protected]>
Cc Dan Williams <[email protected]>
Cc Andrew Morton <[email protected]>
Cc Matthew Wilcox <[email protected]>
Cc Jan Kara <[email protected]>

---
v2: rebase, add more Cc:

 arch/arc/include/asm/page.h |    1 +
 fs/dax.c                    |    1 +
 2 files changed, 2 insertions(+)

fs/dax.c line 28

Quoted 4 lines
fs/dax.c +1 -0
@@ -25,6 +25,7 @@
 #include <linux/sizes.h>
 #include <linux/mmu_notifier.h>
 #include <linux/iomap.h>
+#include <asm/page.h>

I would expect this to come from one of the linux/ includes like linux/mm.h. asm/ headers are implementation linux/ headers are api.

Quoted 3 lines

Once you drop that then the subject of this patch can just be "arc:
add a copy_user_page() implementation", and handled by the arc maintainer (or I can take it with Vineet's ack).

Got it. Thanks.
Vineet is copied. I expect that he will take the v3 patch.

Quoted 8 lines
Quoted 4 lines

fs/dax.c line 29

Quoted 1 line
fs/dax.c +0 -0
 #include <asm/pgalloc.h>

Yes, this one should have a linux/ api header to front it, but that's a cleanup for another day.

That line is only part of the contextual diff in this patch. I guess you are just commenting in general, along with your earlier paragraph.

Yes, I was prefetching a "...hey, but, there's an asm/ include right below this one?"
_______________________________________________
Linux-nvdimm mailing list -- [email protected]
To unsubscribe send an email to [email protected]

maintainer
#6 lore raw
In reply to Randy Dunlap
Quoted 8 lines · Randy Dunlap

fs/dax.c uses copy_user_page() but ARC does not provide that interface, resulting in a build error.

Provide copy_user_page() in <asm/page.h> (beside copy_page()) and add <asm/page.h> to fs/dax.c to fix the build error.

../fs/dax.c: In function 'copy_cow_page_dax':
../fs/dax.c:702:2: error: implicit declaration of function 'copy_user_page'; did you mean 'copy_to_user_page'? [-Werror=implicit-function-declaration]

Could somebody explain what the force-cast is doing in there? I mean, the call is

        copy_user_page(vto, (void __force *)kaddr, vaddr, to);
kaddr is a local variable there, declared as void *; AFAICS, that
had been pure cargo-cult since
commit 7a9eb20666317794d0279843fbd091af93907780
Author: Dan Williams <[email protected]>
Date:   Fri Jun 3 18:06:47 2016 -0700

pmem: kill __pmem address space

I mean, it's been more than 4 years, time to bury that body...

_______________________________________________
linux-snps-arc mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-snps-arc