#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
return err;
}
-#if 0
static int ceph_readpages(struct file *file, struct address_space *mapping,
struct list_head *pages, unsigned nr_pages)
{
}
-#endif
/*
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
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,