]> git.neil.brown.name Git - history.git/commitdiff
[JFS] direct-to-BIO pagecache IO
authorDave Kleikamp <shaggy@kleikamp.austin.ibm.com>
Thu, 22 Aug 2002 06:15:36 +0000 (01:15 -0500)
committerDave Kleikamp <shaggy@kleikamp.austin.ibm.com>
Thu, 22 Aug 2002 06:15:36 +0000 (01:15 -0500)
This comes from Andrew Morton.

Implements readpages and writepages operations.
Replaces use of block_read_full_page by mpage_readpage.

fs/jfs/inode.c

index cb97ce6f672c3d19b2a04813513bb70aa820ad0e..226926fd3a9638f6585df6d60e39c642712486ac 100644 (file)
@@ -18,6 +18,7 @@
  */
 
 #include <linux/fs.h>
+#include <linux/mpage.h>
 #include <linux/buffer_head.h>
 #include "jfs_incore.h"
 #include "jfs_filsys.h"
@@ -271,9 +272,20 @@ static int jfs_writepage(struct page *page)
        return block_write_full_page(page, jfs_get_block);
 }
 
+static int jfs_writepages(struct address_space *mapping, int *nr_to_write)
+{
+       return mpage_writepages(mapping, nr_to_write, jfs_get_block);
+}
+
 static int jfs_readpage(struct file *file, struct page *page)
 {
-       return block_read_full_page(page, jfs_get_block);
+       return mpage_readpage(page, jfs_get_block);
+}
+
+static int jfs_readpages(struct address_space *mapping,
+               struct list_head *pages, unsigned nr_pages)
+{
+       return mpage_readpages(mapping, pages, nr_pages, jfs_get_block);
 }
 
 static int jfs_prepare_write(struct file *file,
@@ -308,7 +320,9 @@ static int jfs_direct_IO(int rw, struct inode *inode, char *buf,
 
 struct address_space_operations jfs_aops = {
        .readpage       = jfs_readpage,
+       .readpages      = jfs_readpages,
        .writepage      = jfs_writepage,
+       .writepages     = jfs_writepages,
        .sync_page      = block_sync_page,
        .prepare_write  = jfs_prepare_write,
        .commit_write   = generic_commit_write,