diff mbox series

mm: filemap: provide dummy filemap_page_mkwrite() for NOMMU

Message ID 20180409105555.2439976-1-arnd@arndb.de
State Accepted
Commit 453972283dcbf61fa33c8c0540d9b5e0caf9d570
Headers show
Series mm: filemap: provide dummy filemap_page_mkwrite() for NOMMU | expand

Commit Message

Arnd Bergmann April 9, 2018, 10:55 a.m. UTC
Building orangefs on MMU-less machines now results in a link error because
of the newly introduced use of the filemap_page_mkwrite() function:

ERROR: "filemap_page_mkwrite" [fs/orangefs/orangefs.ko] undefined!

This adds a dummy version for it, similar to the existing
generic_file_mmap and generic_file_readonly_mmap stubs in the same file,
to avoid the link error without adding #ifdefs in each file system that
uses these.

Cc: Martin Brandenburg <martin@omnibond.com>
Cc: Mike Marshall <hubcap@omnibond.com>
Fixes: a5135eeab2e5 ("orangefs: implement vm_ops->fault")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

---
 mm/filemap.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

-- 
2.9.0

Comments

Jan Kara April 9, 2018, 3:18 p.m. UTC | #1
On Mon 09-04-18 12:55:42, Arnd Bergmann wrote:
> Building orangefs on MMU-less machines now results in a link error because

> of the newly introduced use of the filemap_page_mkwrite() function:

> 

> ERROR: "filemap_page_mkwrite" [fs/orangefs/orangefs.ko] undefined!

> 

> This adds a dummy version for it, similar to the existing

> generic_file_mmap and generic_file_readonly_mmap stubs in the same file,

> to avoid the link error without adding #ifdefs in each file system that

> uses these.

> 

> Cc: Martin Brandenburg <martin@omnibond.com>

> Cc: Mike Marshall <hubcap@omnibond.com>

> Fixes: a5135eeab2e5 ("orangefs: implement vm_ops->fault")

> Signed-off-by: Arnd Bergmann <arnd@arndb.de>


OK, makes sense. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>


								Honza

> ---

>  mm/filemap.c | 6 +++++-

>  1 file changed, 5 insertions(+), 1 deletion(-)

> 

> diff --git a/mm/filemap.c b/mm/filemap.c

> index ab77e19ab09c..9276bdb2343c 100644

> --- a/mm/filemap.c

> +++ b/mm/filemap.c

> @@ -2719,7 +2719,6 @@ int filemap_page_mkwrite(struct vm_fault *vmf)

>  	sb_end_pagefault(inode->i_sb);

>  	return ret;

>  }

> -EXPORT_SYMBOL(filemap_page_mkwrite);

>  

>  const struct vm_operations_struct generic_file_vm_ops = {

>  	.fault		= filemap_fault,

> @@ -2750,6 +2749,10 @@ int generic_file_readonly_mmap(struct file *file, struct vm_area_struct *vma)

>  	return generic_file_mmap(file, vma);

>  }

>  #else

> +int filemap_page_mkwrite(struct vm_fault *vmf)

> +{

> +	return -ENOSYS;

> +}

>  int generic_file_mmap(struct file * file, struct vm_area_struct * vma)

>  {

>  	return -ENOSYS;

> @@ -2760,6 +2763,7 @@ int generic_file_readonly_mmap(struct file * file, struct vm_area_struct * vma)

>  }

>  #endif /* CONFIG_MMU */

>  

> +EXPORT_SYMBOL(filemap_page_mkwrite);

>  EXPORT_SYMBOL(generic_file_mmap);

>  EXPORT_SYMBOL(generic_file_readonly_mmap);

>  

> -- 

> 2.9.0

> 

-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR
diff mbox series

Patch

diff --git a/mm/filemap.c b/mm/filemap.c
index ab77e19ab09c..9276bdb2343c 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -2719,7 +2719,6 @@  int filemap_page_mkwrite(struct vm_fault *vmf)
 	sb_end_pagefault(inode->i_sb);
 	return ret;
 }
-EXPORT_SYMBOL(filemap_page_mkwrite);
 
 const struct vm_operations_struct generic_file_vm_ops = {
 	.fault		= filemap_fault,
@@ -2750,6 +2749,10 @@  int generic_file_readonly_mmap(struct file *file, struct vm_area_struct *vma)
 	return generic_file_mmap(file, vma);
 }
 #else
+int filemap_page_mkwrite(struct vm_fault *vmf)
+{
+	return -ENOSYS;
+}
 int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
 {
 	return -ENOSYS;
@@ -2760,6 +2763,7 @@  int generic_file_readonly_mmap(struct file * file, struct vm_area_struct * vma)
 }
 #endif /* CONFIG_MMU */
 
+EXPORT_SYMBOL(filemap_page_mkwrite);
 EXPORT_SYMBOL(generic_file_mmap);
 EXPORT_SYMBOL(generic_file_readonly_mmap);