struct *file, and call in odbfs_write_one_page() to use new parameters.
Updated gen_copy_data() to round up the number of pages copied in while loop.
/* rw.c */
struct page *obdfs_getpage(struct inode *inode, unsigned long offset, int create, int locked);
/* rw.c */
struct page *obdfs_getpage(struct inode *inode, unsigned long offset, int create, int locked);
-int obdfs_writepage(struct file *file, struct page *page);
int obdfs_write_one_page(struct file *file, struct page *page, unsigned long offset, unsigned long bytes, const char * buf);
/* namei.c */
int obdfs_write_one_page(struct file *file, struct page *page, unsigned long offset, unsigned long bytes, const char * buf);
/* namei.c */
- while (index < src->i_size / PAGE_SIZE) {
+ while (index < ((src->i_size + PAGE_SIZE - 1) >> PAGE_SHIFT)) {
page->index = index;
rc = OBP(conn->oc_dev, brw)(READ, conn, src, page, 0);
page->index = index;
rc = OBP(conn->oc_dev, brw)(READ, conn, src, page, 0);
#endif
/* returns the page unlocked, but with a reference */
#endif
/* returns the page unlocked, but with a reference */
-int obdfs_readpage(struct file *file, struct page *page)
+int obdfs_readpage(struct dentry *dentry, struct page *page)
- struct inode *inode = file->f_dentry->d_inode;
+ struct inode *inode = dentry->d_inode;
/* XXX flush stuff */
PDEBUG(page, "READ");
rc = iops(inode)->o_brw(READ, iid(inode),inode, page, 0);
/* XXX flush stuff */
PDEBUG(page, "READ");
rc = iops(inode)->o_brw(READ, iid(inode),inode, page, 0);
+/* returns the page unlocked, but with a reference */
+static int obdfs_writepage(struct dentry *dentry, struct page *page)
+{
+ struct inode *inode = dentry->d_inode;
+ int rc;
+
+ ENTRY;
+ PDEBUG(page, "WRITEPAGE");
+ /* XXX flush stuff */
+
+ rc = iops(inode)->o_brw(WRITE, iid(inode), inode, page, 1);
+
+ SetPageUptodate(page);
+ PDEBUG(page,"WRITEPAGE");
+ return rc;
+}
+
/*
* This does the "real" work of the write. The generic routine has
* allocated the page, locked it, done all the page alignment stuff
/*
* This does the "real" work of the write. The generic routine has
* allocated the page, locked it, done all the page alignment stuff
if (bytes) {
lock_kernel();
if (bytes) {
lock_kernel();
- status = obdfs_writepage(file, page);
+ status = obdfs_writepage(file->f_dentry, page);
-/* returns the page unlocked, but with a reference */
-int obdfs_writepage(struct file *file, struct page *page)
-{
- struct inode *inode = file->f_dentry->d_inode;
- int rc;
-
- ENTRY;
- PDEBUG(page, "WRITEPAGE");
- /* XXX flush stuff */
-
- rc = iops(inode)->o_brw(WRITE, iid(inode), inode, page, 1);
-
- SetPageUptodate(page);
- PDEBUG(page,"WRITEPAGE");
- return rc;
-}
-
void report_inode(struct page * page) {
struct inode *inode = (struct inode *)0;
void report_inode(struct page * page) {
struct inode *inode = (struct inode *)0;
--- /dev/null
+#! /bin/bash
+
+insmod loop
+dd if=/dev/zero of=/tmp/fs bs=1024 count=10000
+losetup /dev/loop0 /tmp/fs
+mke2fs -b 4096 /dev/loop0