Skip to contentSkip to conversation

Make ->readpages palatable to NFS

PATCH New Trond Myklebust 1 participant 1 message Nov 6, 2002

Subsystems (8)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make ->readpages palatable to NFS

The following patch makes the ->readpages() address_space_operation take a struct file argument just like ->readpage().

Cheers,
Trond

fs/ext2/inode.c +1 -1
diff -u --recursive --new-file linux-2.5.46/fs/ext2/inode.c linux-2.5.46-01-readpages1/fs/ext2/inode.c
@@ -599,7 +599,7 @@
 }
 
 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);
fs/ext3/inode.c +1 -1
diff -u --recursive --new-file linux-2.5.46/fs/ext3/inode.c linux-2.5.46-01-readpages1/fs/ext3/inode.c
@@ -1385,7 +1385,7 @@
 }
 
 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);
fs/jfs/inode.c +1 -1
diff -u --recursive --new-file linux-2.5.46/fs/jfs/inode.c linux-2.5.46-01-readpages1/fs/jfs/inode.c
@@ -293,7 +293,7 @@
 	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);
fs/xfs/linux/xfs_aops.c +1 -0
diff -u --recursive --new-file linux-2.5.46/fs/xfs/linux/xfs_aops.c linux-2.5.46-01-readpages1/fs/xfs/linux/xfs_aops.c
@@ -644,6 +644,7 @@
 
 STATIC int
 linvfs_readpages(
+	struct file		*unused,
 	struct address_space	*mapping,
 	struct list_head	*pages,
 	unsigned		nr_pages)
include/linux/fs.h +1 -1
diff -u --recursive --new-file linux-2.5.46/include/linux/fs.h linux-2.5.46-01-readpages1/include/linux/fs.h
@@ -297,7 +297,7 @@
 	/* 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);
 
 	/*
mm/readahead.c +1 -1
diff -u --recursive --new-file linux-2.5.46/mm/readahead.c linux-2.5.46-01-readpages1/mm/readahead.c
@@ -52,7 +52,7 @@
 	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);