Commit 7b429e1a authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds

[PATCH] add MAP_POPULATE/sys_remap_file_pages support to XFS

filemap_populate needs to be exported so that filesystems with their own
vm_operations (like XFS) can use it.

Cc: Nathan Scott <nathans@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 75687453
...@@ -531,6 +531,7 @@ struct file_operations linvfs_dir_operations = { ...@@ -531,6 +531,7 @@ struct file_operations linvfs_dir_operations = {
static struct vm_operations_struct linvfs_file_vm_ops = { static struct vm_operations_struct linvfs_file_vm_ops = {
.nopage = filemap_nopage, .nopage = filemap_nopage,
.populate = filemap_populate,
#ifdef HAVE_VMOP_MPROTECT #ifdef HAVE_VMOP_MPROTECT
.mprotect = linvfs_mprotect, .mprotect = linvfs_mprotect,
#endif #endif
......
...@@ -756,7 +756,9 @@ extern unsigned long page_unuse(struct page *); ...@@ -756,7 +756,9 @@ extern unsigned long page_unuse(struct page *);
extern void truncate_inode_pages(struct address_space *, loff_t); extern void truncate_inode_pages(struct address_space *, loff_t);
/* generic vm_area_ops exported for stackable file systems */ /* generic vm_area_ops exported for stackable file systems */
struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int *); extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int *);
extern int filemap_populate(struct vm_area_struct *, unsigned long,
unsigned long, pgprot_t, unsigned long, int);
/* mm/page-writeback.c */ /* mm/page-writeback.c */
int write_one_page(struct page *page, int wait); int write_one_page(struct page *page, int wait);
......
...@@ -1458,12 +1458,9 @@ static struct page * filemap_getpage(struct file *file, unsigned long pgoff, ...@@ -1458,12 +1458,9 @@ static struct page * filemap_getpage(struct file *file, unsigned long pgoff,
return NULL; return NULL;
} }
static int filemap_populate(struct vm_area_struct *vma, int filemap_populate(struct vm_area_struct *vma, unsigned long addr,
unsigned long addr, unsigned long len, pgprot_t prot, unsigned long pgoff,
unsigned long len, int nonblock)
pgprot_t prot,
unsigned long pgoff,
int nonblock)
{ {
struct file *file = vma->vm_file; struct file *file = vma->vm_file;
struct address_space *mapping = file->f_mapping; struct address_space *mapping = file->f_mapping;
...@@ -1523,6 +1520,7 @@ int generic_file_mmap(struct file * file, struct vm_area_struct * vma) ...@@ -1523,6 +1520,7 @@ int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
vma->vm_ops = &generic_file_vm_ops; vma->vm_ops = &generic_file_vm_ops;
return 0; return 0;
} }
EXPORT_SYMBOL(filemap_populate);
/* /*
* This is for filesystems which do not implement ->writepage. * This is for filesystems which do not implement ->writepage.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment