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 = {
static struct vm_operations_struct linvfs_file_vm_ops = {
.nopage = filemap_nopage,
.populate = filemap_populate,
#ifdef HAVE_VMOP_MPROTECT
.mprotect = linvfs_mprotect,
#endif
......
......@@ -756,7 +756,9 @@ extern unsigned long page_unuse(struct page *);
extern void truncate_inode_pages(struct address_space *, loff_t);
/* 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 */
int write_one_page(struct page *page, int wait);
......
......@@ -1458,11 +1458,8 @@ static struct page * filemap_getpage(struct file *file, unsigned long pgoff,
return NULL;
}
static int filemap_populate(struct vm_area_struct *vma,
unsigned long addr,
unsigned long len,
pgprot_t prot,
unsigned long pgoff,
int filemap_populate(struct vm_area_struct *vma, unsigned long addr,
unsigned long len, pgprot_t prot, unsigned long pgoff,
int nonblock)
{
struct file *file = vma->vm_file;
......@@ -1523,6 +1520,7 @@ int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
vma->vm_ops = &generic_file_vm_ops;
return 0;
}
EXPORT_SYMBOL(filemap_populate);
/*
* 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