Commit b729e488 authored by Trond Myklebust's avatar Trond Myklebust Committed by Linus Torvalds

[PATCH] Make ->readpages palatable to NFS

The following patch makes the ->readpages() address_space_operation
take a struct file argument just like ->readpage().
parent 6b886bd8
......@@ -599,7 +599,7 @@ static int ext2_readpage(struct file *file, struct page *page)
}
static int
ext2_readpages(struct address_space *mapping,
ext2_readpages(struct file *file, struct address_space *mapping,
struct list_head *pages, unsigned nr_pages)
{
return mpage_readpages(mapping, pages, nr_pages, ext2_get_block);
......
......@@ -1385,7 +1385,7 @@ static int ext3_readpage(struct file *file, struct page *page)
}
static int
ext3_readpages(struct address_space *mapping,
ext3_readpages(struct file *file, struct address_space *mapping,
struct list_head *pages, unsigned nr_pages)
{
return mpage_readpages(mapping, pages, nr_pages, ext3_get_block);
......
......@@ -293,7 +293,7 @@ static int jfs_readpage(struct file *file, struct page *page)
return mpage_readpage(page, jfs_get_block);
}
static int jfs_readpages(struct address_space *mapping,
static int jfs_readpages(struct file *file, struct address_space *mapping,
struct list_head *pages, unsigned nr_pages)
{
return mpage_readpages(mapping, pages, nr_pages, jfs_get_block);
......
......@@ -644,6 +644,7 @@ linvfs_readpage(
STATIC int
linvfs_readpages(
struct file *unused,
struct address_space *mapping,
struct list_head *pages,
unsigned nr_pages)
......
......@@ -297,7 +297,7 @@ struct address_space_operations {
/* Set a page dirty */
int (*set_page_dirty)(struct page *page);
int (*readpages)(struct address_space *mapping,
int (*readpages)(struct file *filp, struct address_space *mapping,
struct list_head *pages, unsigned nr_pages);
/*
......
......@@ -52,7 +52,7 @@ read_pages(struct address_space *mapping, struct file *filp,
pagevec_init(&lru_pvec, 0);
if (mapping->a_ops->readpages)
return mapping->a_ops->readpages(mapping, pages, nr_pages);
return mapping->a_ops->readpages(filp, mapping, pages, nr_pages);
for (page_idx = 0; page_idx < nr_pages; page_idx++) {
struct page *page = list_entry(pages->prev, struct page, list);
......
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