]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
enabled readpages
authorDongsu Park <dpark1978@gmail.com>
Wed, 19 Mar 2008 16:35:30 +0000 (09:35 -0700)
committerSage Weil <sage@newdream.net>
Wed, 19 Mar 2008 16:35:30 +0000 (09:35 -0700)
src/kernel/addr.c

index 7a3bf7383e9cf1f51109a09cd835076cfb6c2013..fc497740ee9ddd114b51d703b0a6255641212875 100644 (file)
@@ -2,6 +2,7 @@
 #include <linux/fs.h>
 #include <linux/mm.h>
 #include <linux/pagemap.h>
+#include <linux/writeback.h>   /* generic_writepages */
 
 int ceph_debug_addr = 50;
 #define DOUT_VAR ceph_debug_addr
@@ -31,7 +32,6 @@ out_unlock:
        return err;
 }
 
-#if 0
 static int ceph_readpages(struct file *file, struct address_space *mapping,
                          struct list_head *pages, unsigned nr_pages)
 {
@@ -53,7 +53,6 @@ out_unlock:
 
 
 }
-#endif
 
 
 /*
@@ -103,6 +102,29 @@ out_unlock:
        return err;
 }
 
+/*
+ * ceph_writepages:
+ *  do write jobs for several pages
+ */
+static int ceph_writepages(struct address_space *mapping, struct writeback_control *wbc)
+{
+#if 0
+       struct inode *inode = mapping->host;
+       struct ceph_pageio_descriptor pgio;
+       int err;
+
+       ceph_pageio_init_write(&pgio, inode, wb_priority(wbc));
+       wbc->fs_private = &pgio;
+       err = generic_writepages(mapping, wbc);
+       if (err)
+               return err;
+
+       return 0;
+#endif
+
+       return generic_writepages(mapping, wbc);
+}
+
 /*
  * ceph_prepare_write:
  *  allocate and initialize buffer heads for each page
@@ -220,8 +242,7 @@ static int ceph_commit_write(struct file *filp, struct page *page,
 
 const struct address_space_operations ceph_aops = {
        .readpage = ceph_readpage,
-//     .readpages = ceph_readpages
-//     .writepage = ceph_writepage,
+       .readpages = ceph_readpages,
        .prepare_write = ceph_prepare_write,
        .commit_write = ceph_commit_write,
        .writepage = ceph_writepage,