diff -ur linux-orig/fs/adfs/inode.c linux/fs/adfs/inode.c --- linux-orig/fs/adfs/inode.c Wed May 3 15:47:38 2000 +++ linux/fs/adfs/inode.c Wed May 3 18:07:03 2000 @@ -49,17 +49,17 @@ return 0; } -static int adfs_writepage(struct file *file, struct dentry *dentry, struct page *page) +static int adfs_writepage(void *cookie, struct page *page) { return block_write_full_page(page, adfs_get_block); } -static int adfs_readpage(struct dentry *dentry, struct page *page) +static int adfs_readpage(void *cookie, struct page *page) { return block_read_full_page(page, adfs_get_block); } -static int adfs_prepare_write(struct file *file, struct page *page, unsigned int from, unsigned int to) +static int adfs_prepare_write(void *cookie, struct page *page, unsigned int from, unsigned int to) { return cont_prepare_write(page, from, to, adfs_get_block, &((struct inode *)page->mapping->host)->u.adfs_i.mmu_private); diff -ur linux-orig/fs/affs/file.c linux/fs/affs/file.c --- linux-orig/fs/affs/file.c Wed May 3 15:47:35 2000 +++ linux/fs/affs/file.c Wed May 3 18:13:53 2000 @@ -338,15 +338,15 @@ } -static int affs_writepage(struct file *file, struct dentry *dentry, struct page *page) +static int affs_writepage(void *cookie, struct page *page) { return block_write_full_page(page,affs_get_block); } -static int affs_readpage(struct dentry *dentry, struct page *page) +static int affs_readpage(void *cookie, struct page *page) { return block_read_full_page(page,affs_get_block); } -static int affs_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to) +static int affs_prepare_write(void *cookie, struct page *page, unsigned from, unsigned to) { return cont_prepare_write(page,from,to,affs_get_block, &((struct inode*)page->mapping->host)->u.affs_i.mmu_private); diff -ur linux-orig/fs/affs/symlink.c linux/fs/affs/symlink.c --- linux-orig/fs/affs/symlink.c Wed May 3 15:47:35 2000 +++ linux/fs/affs/symlink.c Wed May 3 18:16:04 2000 @@ -15,10 +15,10 @@ #include #include -static int affs_symlink_readpage(struct dentry *dentry, struct page *page) +static int affs_symlink_readpage(void *cookie, struct page *page) { struct buffer_head *bh; - struct inode *inode = dentry->d_inode; + struct inode *inode = (struct inode*)page->mapping->host; char *link = (char*)kmap(page); struct slink_front *lf; int err; diff -ur linux-orig/fs/bfs/file.c linux/fs/bfs/file.c --- linux-orig/fs/bfs/file.c Wed May 3 15:47:38 2000 +++ linux/fs/bfs/file.c Wed May 3 18:17:27 2000 @@ -127,17 +127,17 @@ return err; } -static int bfs_writepage(struct file *file, struct dentry *dentry, struct page *page) +static int bfs_writepage(void *cookie, struct page *page) { return block_write_full_page(page, bfs_get_block); } -static int bfs_readpage(struct dentry *dentry, struct page *page) +static int bfs_readpage(void *cookie, struct page *page) { return block_read_full_page(page, bfs_get_block); } -static int bfs_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to) +static int bfs_prepare_write(void *cookie, struct page *page, unsigned from, unsigned to) { return block_prepare_write(page, from, to, bfs_get_block); } diff -ur linux-orig/fs/buffer.c linux/fs/buffer.c --- linux-orig/fs/buffer.c Wed May 3 15:47:34 2000 +++ linux/fs/buffer.c Wed May 3 19:11:57 2000 @@ -1691,7 +1691,7 @@ return err; } -int generic_commit_write(struct file *file, struct page *page, +int generic_commit_write(void *cookie, struct page *page, unsigned from, unsigned to) { struct inode *inode = (struct inode*)page->mapping->host; @@ -2412,7 +2412,7 @@ return 0; } -int block_sync_page(struct page *page) +int block_sync_page(void *cookie, struct page *page) { run_task_queue(&tq_disk); return 0; diff -ur linux-orig/fs/coda/symlink.c linux/fs/coda/symlink.c --- linux-orig/fs/coda/symlink.c Wed May 3 15:47:35 2000 +++ linux/fs/coda/symlink.c Wed May 3 18:52:06 2000 @@ -22,9 +22,9 @@ #include #include -static int coda_symlink_filler(struct dentry *dentry, struct page *page) +static int coda_symlink_filler(void *cookie, struct page *page) { - struct inode *inode = dentry->d_inode; + struct inode *inode = (struct inode*)page->mapping->host; int error; struct coda_inode_info *cnp; unsigned int len = PAGE_SIZE; diff -ur linux-orig/fs/cramfs/inode.c linux/fs/cramfs/inode.c --- linux-orig/fs/cramfs/inode.c Wed May 3 15:47:39 2000 +++ linux/fs/cramfs/inode.c Wed May 3 18:20:18 2000 @@ -303,9 +303,9 @@ return NULL; } -static int cramfs_readpage(struct dentry *dentry, struct page * page) +static int cramfs_readpage(void *cookie, struct page * page) { - struct inode *inode = dentry->d_inode; + struct inode *inode = (struct inode*)page->mapping->host; u32 maxblock, bytes_filled; maxblock = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; diff -ur linux-orig/fs/efs/inode.c linux/fs/efs/inode.c --- linux-orig/fs/efs/inode.c Wed May 3 15:47:38 2000 +++ linux/fs/efs/inode.c Wed May 3 18:21:42 2000 @@ -11,7 +11,7 @@ #include extern int efs_get_block(struct inode *, long, struct buffer_head *, int); -static int efs_readpage(struct dentry *dentry, struct page *page) +static int efs_readpage(void *cookie, struct page *page) { return block_read_full_page(page,efs_get_block); } diff -ur linux-orig/fs/efs/symlink.c linux/fs/efs/symlink.c --- linux-orig/fs/efs/symlink.c Wed May 3 15:47:38 2000 +++ linux/fs/efs/symlink.c Wed May 3 18:22:20 2000 @@ -10,11 +10,11 @@ #include #include -static int efs_symlink_readpage(struct dentry *dentry, struct page *page) +static int efs_symlink_readpage(void *cookie, struct page *page) { char *link = (char*)kmap(page); struct buffer_head * bh; - struct inode * inode = dentry->d_inode; + struct inode * inode = (struct inode*)page->mapping->host; efs_block_t size = inode->i_size; int err; diff -ur linux-orig/fs/ext2/inode.c linux/fs/ext2/inode.c --- linux-orig/fs/ext2/inode.c Wed May 3 15:47:34 2000 +++ linux/fs/ext2/inode.c Wed May 3 18:26:41 2000 @@ -620,15 +620,15 @@ return NULL; } -static int ext2_writepage(struct file *file, struct dentry *dentry, struct page *page) +static int ext2_writepage(void *cookie, struct page *page) { return block_write_full_page(page,ext2_get_block); } -static int ext2_readpage(struct dentry *dentry, struct page *page) +static int ext2_readpage(void *cookie, struct page *page) { return block_read_full_page(page,ext2_get_block); } -static int ext2_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to) +static int ext2_prepare_write(void *cookie, struct page *page, unsigned from, unsigned to) { return block_prepare_write(page,from,to,ext2_get_block); } diff -ur linux-orig/fs/fat/inode.c linux/fs/fat/inode.c --- linux-orig/fs/fat/inode.c Wed May 3 15:47:35 2000 +++ linux/fs/fat/inode.c Wed May 3 18:27:39 2000 @@ -729,15 +729,15 @@ return 0; } -static int fat_writepage(struct file *file, struct dentry *dentry, struct page *page) +static int fat_writepage(void *cookie, struct page *page) { return block_write_full_page(page,fat_get_block); } -static int fat_readpage(struct dentry *dentry, struct page *page) +static int fat_readpage(void *cookie, struct page *page) { return block_read_full_page(page,fat_get_block); } -static int fat_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to) +static int fat_prepare_write(void *cookie, struct page *page, unsigned from, unsigned to) { return cont_prepare_write(page,from,to,fat_get_block, &MSDOS_I((struct inode*)page->mapping->host)->mmu_private); diff -ur linux-orig/fs/hfs/inode.c linux/fs/hfs/inode.c --- linux-orig/fs/hfs/inode.c Wed May 3 15:47:38 2000 +++ linux/fs/hfs/inode.c Wed May 3 18:30:55 2000 @@ -217,15 +217,15 @@ return __hfs_notify_change(dentry, attr, HFS_HDR); } -static int hfs_writepage(struct file *file, struct dentry *dentry, struct page *page) +static int hfs_writepage(void *cookie, struct page *page) { return block_write_full_page(page,hfs_get_block); } -static int hfs_readpage(struct dentry *dentry, struct page *page) +static int hfs_readpage(void *cookie, struct page *page) { return block_read_full_page(page,hfs_get_block); } -static int hfs_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to) +static int hfs_prepare_write(void *cookie, struct page *page, unsigned from, unsigned to) { return cont_prepare_write(page,from,to,hfs_get_block, &((struct inode*)page->mapping->host)->u.hfs_i.mmu_private); diff -ur linux-orig/fs/hpfs/file.c linux/fs/hpfs/file.c --- linux-orig/fs/hpfs/file.c Wed May 3 15:47:35 2000 +++ linux/fs/hpfs/file.c Wed May 3 18:33:00 2000 @@ -86,15 +86,15 @@ return 0; } -static int hpfs_writepage(struct file *file, struct dentry *dentry, struct page *page) +static int hpfs_writepage(void *cookie, struct page *page) { return block_write_full_page(page,hpfs_get_block); } -static int hpfs_readpage(struct dentry *dentry, struct page *page) +static int hpfs_readpage(void *cookie, struct page *page) { return block_read_full_page(page,hpfs_get_block); } -static int hpfs_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to) +static int hpfs_prepare_write(void *cookie, struct page *page, unsigned from, unsigned to) { return cont_prepare_write(page,from,to,hpfs_get_block, &((struct inode*)page->mapping->host)->u.hpfs_i.mmu_private); diff -ur linux-orig/fs/hpfs/hpfs_fn.h linux/fs/hpfs/hpfs_fn.h --- linux-orig/fs/hpfs/hpfs_fn.h Wed May 3 15:47:35 2000 +++ linux/fs/hpfs/hpfs_fn.h Wed May 3 20:29:59 2000 @@ -301,7 +301,7 @@ int hpfs_symlink(struct inode *, struct dentry *, const char *); int hpfs_unlink(struct inode *, struct dentry *); int hpfs_rmdir(struct inode *, struct dentry *); -int hpfs_symlink_readpage(struct dentry *, struct page *); +int hpfs_symlink_readpage(void *, struct page *); int hpfs_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); /* super.c */ diff -ur linux-orig/fs/hpfs/namei.c linux/fs/hpfs/namei.c --- linux-orig/fs/hpfs/namei.c Wed May 3 15:47:35 2000 +++ linux/fs/hpfs/namei.c Wed May 3 18:34:03 2000 @@ -393,10 +393,10 @@ return r == 2 ? -ENOSPC : r == 1 ? -EFSERROR : 0; } -int hpfs_symlink_readpage(struct dentry *dentry, struct page *page) +int hpfs_symlink_readpage(void *cookie, struct page *page) { char *link = (char*)kmap(page); - struct inode *i = dentry->d_inode; + struct inode *i = (struct inode*)page->mapping->host; struct fnode *fnode; struct buffer_head *bh; int err; diff -ur linux-orig/fs/isofs/inode.c linux/fs/isofs/inode.c --- linux-orig/fs/isofs/inode.c Wed May 3 15:47:34 2000 +++ linux/fs/isofs/inode.c Wed May 3 18:35:52 2000 @@ -981,7 +981,7 @@ return 0; } -static int isofs_readpage(struct dentry *dentry, struct page *page) +static int isofs_readpage(void *cookie, struct page *page) { return block_read_full_page(page,isofs_get_block); } diff -ur linux-orig/fs/isofs/rock.c linux/fs/isofs/rock.c --- linux-orig/fs/isofs/rock.c Wed May 3 15:47:34 2000 +++ linux/fs/isofs/rock.c Wed May 3 18:37:47 2000 @@ -445,9 +445,9 @@ /* readpage() for symlinks: reads symlink contents into the page and either makes it uptodate and returns 0 or returns error (-EIO) */ -static int rock_ridge_symlink_readpage(struct dentry *dentry, struct page *page) +static int rock_ridge_symlink_readpage(void *cookie, struct page *page) { - struct inode *inode = dentry->d_inode; + struct inode *inode = (struct inode*)page->mapping->host; char *link = (char*)kmap(page); unsigned long bufsize = ISOFS_BUFFER_SIZE(inode); unsigned char bufbits = ISOFS_BUFFER_BITS(inode); diff -ur linux-orig/fs/minix/inode.c linux/fs/minix/inode.c --- linux-orig/fs/minix/inode.c Wed May 3 15:47:34 2000 +++ linux/fs/minix/inode.c Wed May 3 18:38:23 2000 @@ -1006,15 +1006,15 @@ return NULL; } -static int minix_writepage(struct file *file, struct dentry *dentry, struct page *page) +static int minix_writepage(void *cookie, struct page *page) { return block_write_full_page(page,minix_get_block); } -static int minix_readpage(struct dentry *dentry, struct page *page) +static int minix_readpage(void *cookie, struct page *page) { return block_read_full_page(page,minix_get_block); } -static int minix_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to) +static int minix_prepare_write(void *cookie, struct page *page, unsigned from, unsigned to) { return block_prepare_write(page,from,to,minix_get_block); } diff -ur linux-orig/fs/ncpfs/symlink.c linux/fs/ncpfs/symlink.c --- linux-orig/fs/ncpfs/symlink.c Wed May 3 15:47:35 2000 +++ linux/fs/ncpfs/symlink.c Wed May 3 18:53:06 2000 @@ -43,9 +43,9 @@ /* ----- read a symbolic link ------------------------------------------ */ -static int ncp_symlink_readpage(struct dentry *dentry, struct page *page) +static int ncp_symlink_readpage(void *cookie, struct page *page) { - struct inode *inode=dentry->d_inode; + struct inode *inode = (struct inode*)page->mapping->host; int error, length, len, cnt; char *link; char *buf = (char*)kmap(page); diff -ur linux-orig/fs/nfs/file.c linux/fs/nfs/file.c --- linux-orig/fs/nfs/file.c Wed May 3 15:47:34 2000 +++ linux/fs/nfs/file.c Wed May 3 19:04:30 2000 @@ -150,14 +150,16 @@ * If the writer ends up delaying the write, the writer needs to * increment the page use counts until he is done with the page. */ -static int nfs_prepare_write(struct file *file, struct page *page, unsigned offset, unsigned to) +static int nfs_prepare_write(void *cookie, struct page *page, unsigned offset, unsigned to) { + struct file *file = (struct file *)cookie; kmap(page); return nfs_flush_incompatible(file, page); } -static int nfs_commit_write(struct file *file, struct page *page, unsigned offset, unsigned to) +static int nfs_commit_write(void *cookie, struct page *page, unsigned offset, unsigned to) { long status; + struct file *file = (struct file *)cookie; loff_t pos = ((loff_t)page->index<mapping->host; @@ -175,7 +177,7 @@ * The following is used by wait_on_page(), generic_file_readahead() * to initiate the completion of any page readahead operations. */ -static int nfs_sync_page(struct page *page) +static int nfs_sync_page(void *cookie, struct page *page) { struct inode *inode = (struct inode *)page->mapping->host; unsigned long index = page_index(page); diff -ur linux-orig/fs/nfs/read.c linux/fs/nfs/read.c --- linux-orig/fs/nfs/read.c Wed May 3 15:47:34 2000 +++ linux/fs/nfs/read.c Wed May 3 19:08:27 2000 @@ -472,9 +472,10 @@ * - The server is congested. */ int -nfs_readpage(struct dentry *dentry, struct page *page) +nfs_readpage(void *cookie, struct page *page) { - struct inode *inode = dentry->d_inode; + struct dentry *dentry = ((struct file *)cookie)->f_dentry; + struct inode *inode = (struct inode*)page->mapping->host; int error; dprintk("NFS: nfs_readpage (%p %ld@%lu)\n", diff -ur linux-orig/fs/nfs/write.c linux/fs/nfs/write.c --- linux-orig/fs/nfs/write.c Wed May 3 15:47:34 2000 +++ linux/fs/nfs/write.c Wed May 3 19:07:19 2000 @@ -249,9 +249,11 @@ * Write an mmapped page to the server. */ int -nfs_writepage(struct file *file, struct dentry * dentry, struct page *page) +nfs_writepage(void *cookie, struct page *page) { - struct inode *inode = dentry->d_inode; + struct file *file = (struct file *)cookie; + struct dentry *dentry = file->f_dentry; + struct inode *inode = (struct inode*)page->mapping->host; unsigned long end_index = inode->i_size >> PAGE_CACHE_SHIFT; unsigned offset = PAGE_CACHE_SIZE; int err; diff -ur linux-orig/fs/ntfs/fs.c linux/fs/ntfs/fs.c --- linux-orig/fs/ntfs/fs.c Wed May 3 15:47:38 2000 +++ linux/fs/ntfs/fs.c Wed May 3 18:39:06 2000 @@ -587,15 +587,15 @@ #endif }; -static int ntfs_writepage(struct file *file, struct dentry *dentry, struct page *page) +static int ntfs_writepage(void *cookie, struct page *page) { return block_write_full_page(page,ntfs_get_block); } -static int ntfs_readpage(struct dentry *dentry, struct page *page) +static int ntfs_readpage(void *cookie, struct page *page) { return block_read_full_page(page,ntfs_get_block); } -static int ntfs_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to) +static int ntfs_prepare_write(void *cookie, struct page *page, unsigned from, unsigned to) { return cont_prepare_write(page,from,to,ntfs_get_block, &((struct inode*)page->mapping->host)->u.ntfs_i.mmu_private); diff -ur linux-orig/fs/qnx4/inode.c linux/fs/qnx4/inode.c --- linux-orig/fs/qnx4/inode.c Wed May 3 15:47:35 2000 +++ linux/fs/qnx4/inode.c Wed May 3 18:40:03 2000 @@ -410,15 +410,15 @@ return; } -static int qnx4_writepage(struct file *file, struct dentry *dentry, struct page *page) +static int qnx4_writepage(void *cookie, struct page *page) { return block_write_full_page(page,qnx4_get_block); } -static int qnx4_readpage(struct dentry *dentry, struct page *page) +static int qnx4_readpage(void *cookie, struct page *page) { return block_read_full_page(page,qnx4_get_block); } -static int qnx4_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to) +static int qnx4_prepare_write(void *cookie, struct page *page, unsigned from, unsigned to) { return cont_prepare_write(page,from,to,qnx4_get_block, &((struct inode*)page->mapping->host)->u.qnx4_i.mmu_private); diff -ur linux-orig/fs/ramfs/inode.c linux/fs/ramfs/inode.c --- linux-orig/fs/ramfs/inode.c Wed May 3 15:47:39 2000 +++ linux/fs/ramfs/inode.c Wed May 3 18:42:41 2000 @@ -62,7 +62,7 @@ * Read a page. Again trivial. If it didn't already exist * in the page cache, it is zero-filled. */ -static int ramfs_readpage(struct dentry *dentry, struct page * page) +static int ramfs_readpage(void *cookie, struct page * page) { if (!Page_Uptodate(page)) { memset((void *) page_address(page), 0, PAGE_CACHE_SIZE); @@ -76,13 +76,13 @@ * Writing: just make sure the page gets marked dirty, so that * the page stealer won't grab it. */ -static int ramfs_writepage(struct file *file, struct dentry * dentry, struct page *page) +static int ramfs_writepage(void *cookie, struct page *page) { SetPageDirty(page); return 0; } -static int ramfs_prepare_write(struct file *file, struct page *page, unsigned offset, unsigned to) +static int ramfs_prepare_write(void *cookie, struct page *page, unsigned offset, unsigned to) { void *addr; @@ -95,7 +95,7 @@ return 0; } -static int ramfs_commit_write(struct file *file, struct page *page, unsigned offset, unsigned to) +static int ramfs_commit_write(void *cookie, struct page *page, unsigned offset, unsigned to) { struct inode *inode = (struct inode*)page->mapping->host; loff_t pos = ((loff_t)page->index << PAGE_CACHE_SHIFT) + to; diff -ur linux-orig/fs/romfs/inode.c linux/fs/romfs/inode.c --- linux-orig/fs/romfs/inode.c Wed May 3 15:47:35 2000 +++ linux/fs/romfs/inode.c Wed May 3 18:43:50 2000 @@ -388,9 +388,9 @@ */ static int -romfs_readpage(struct dentry * dentry, struct page * page) +romfs_readpage(void * cookie, struct page * page) { - struct inode *inode = dentry->d_inode; + struct inode *inode = (struct inode*)page->mapping->host; unsigned long buf; unsigned long offset, avail, readlen; int result = -EIO; diff -ur linux-orig/fs/smbfs/file.c linux/fs/smbfs/file.c --- linux-orig/fs/smbfs/file.c Wed May 3 15:47:35 2000 +++ linux/fs/smbfs/file.c Wed May 3 19:01:47 2000 @@ -98,9 +98,10 @@ } static int -smb_readpage(struct dentry *dentry, struct page *page) +smb_readpage(void *cookie, struct page *page) { int error; + struct dentry *dentry = ((struct file *)cookie)->f_dentry; pr_debug("SMB: smb_readpage %08lx\n", page_address(page)); #ifdef SMBFS_PARANOIA @@ -167,8 +168,9 @@ * We are called with the page locked and the caller unlocks. */ static int -smb_writepage(struct file *file, struct dentry *dentry, struct page *page) +smb_writepage(void *cookie, struct page *page) { + struct dentry *dentry = ((struct file *)cookie)->f_dentry; struct inode *inode = dentry->d_inode; unsigned long end_index = inode->i_size >> PAGE_CACHE_SHIFT; unsigned offset = PAGE_CACHE_SIZE; @@ -268,15 +270,16 @@ * If the writer ends up delaying the write, the writer needs to * increment the page use counts until he is done with the page. */ -static int smb_prepare_write(struct file *file, struct page *page, unsigned offset, unsigned to) +static int smb_prepare_write(void *cookie, struct page *page, unsigned offset, unsigned to) { kmap(page); return 0; } -static int smb_commit_write(struct file *file, struct page *page, unsigned offset, unsigned to) +static int smb_commit_write(void *cookie, struct page *page, unsigned offset, unsigned to) { int status; + struct file *file = (struct file *)cookie; status = -EFAULT; lock_kernel(); diff -ur linux-orig/fs/sysv/inode.c linux/fs/sysv/inode.c --- linux-orig/fs/sysv/inode.c Wed May 3 15:47:35 2000 +++ linux/fs/sysv/inode.c Wed May 3 18:44:21 2000 @@ -939,15 +939,15 @@ return NULL; } -static int sysv_writepage(struct file *file, struct dentry *dentry, struct page *page) +static int sysv_writepage(void *cookie, struct page *page) { return block_write_full_page(page,sysv_get_block); } -static int sysv_readpage(struct dentry *dentry, struct page *page) +static int sysv_readpage(void *cookie, struct page *page) { return block_read_full_page(page,sysv_get_block); } -static int sysv_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to) +static int sysv_prepare_write(void *cookie, struct page *page, unsigned from, unsigned to) { return block_prepare_write(page,from,to,sysv_get_block); } diff -ur linux-orig/fs/udf/file.c linux/fs/udf/file.c --- linux-orig/fs/udf/file.c Wed May 3 15:47:38 2000 +++ linux/fs/udf/file.c Wed May 3 18:46:24 2000 @@ -42,7 +42,7 @@ #include "udf_i.h" #include "udf_sb.h" -static int udf_adinicb_readpage(struct dentry *dentry, struct page * page) +static int udf_adinicb_readpage(void *cookie, struct page * page) { struct inode *inode = (struct inode *)page->mapping->host; @@ -65,7 +65,7 @@ return 0; } -static int udf_adinicb_writepage(struct file *file, struct dentry *dentry, struct page *page) +static int udf_adinicb_writepage(void *cookie, struct page *page) { struct inode *inode = (struct inode *)page->mapping->host; @@ -87,13 +87,13 @@ return 0; } -static int udf_adinicb_prepare_write(struct file *file, struct page *page, unsigned offset, unsigned to) +static int udf_adinicb_prepare_write(void *cookie, struct page *page, unsigned offset, unsigned to) { kmap(page); return 0; } -static int udf_adinicb_commit_write(struct file *file, struct page *page, unsigned offset, unsigned to) +static int udf_adinicb_commit_write(void *cookie, struct page *page, unsigned offset, unsigned to) { struct inode *inode = (struct inode *)page->mapping->host; diff -ur linux-orig/fs/udf/inode.c linux/fs/udf/inode.c --- linux-orig/fs/udf/inode.c Wed May 3 15:47:38 2000 +++ linux/fs/udf/inode.c Wed May 3 18:49:07 2000 @@ -125,17 +125,17 @@ udf_trunc(inode); } -static int udf_writepage(struct file *file, struct dentry *dentry, struct page *page) +static int udf_writepage(void *cookie, struct page *page) { return block_write_full_page(page, udf_get_block); } -static int udf_readpage(struct dentry *dentry, struct page *page) +static int udf_readpage(void *cookie, struct page *page) { return block_read_full_page(page, udf_get_block); } -static int udf_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to) +static int udf_prepare_write(void *cookie, struct page *page, unsigned from, unsigned to) { return block_prepare_write(page, from, to, udf_get_block); } @@ -202,7 +202,7 @@ mark_buffer_dirty(bh, 1); udf_release_data(bh); - inode->i_data.a_ops->writepage(NULL, NULL, page); + inode->i_data.a_ops->writepage(NULL, page); UnlockPage(page); page_cache_release(page); diff -ur linux-orig/fs/udf/symlink.c linux/fs/udf/symlink.c --- linux-orig/fs/udf/symlink.c Wed May 3 15:47:38 2000 +++ linux/fs/udf/symlink.c Wed May 3 18:48:13 2000 @@ -76,9 +76,9 @@ p[0] = '\0'; } -static int udf_symlink_filler(struct dentry * dentry, struct page *page) +static int udf_symlink_filler(void *cookie, struct page *page) { - struct inode *inode = dentry->d_inode; + struct inode *inode = (struct inode*)page->mapping->host; struct buffer_head *bh = NULL; char *symlink; int err = -EIO; diff -ur linux-orig/fs/ufs/inode.c linux/fs/ufs/inode.c --- linux-orig/fs/ufs/inode.c Wed May 3 15:47:35 2000 +++ linux/fs/ufs/inode.c Wed May 3 18:49:55 2000 @@ -540,15 +540,15 @@ return NULL; } -static int ufs_writepage(struct file *file, struct dentry *dentry, struct page *page) +static int ufs_writepage(void *cookie, struct page *page) { return block_write_full_page(page,ufs_getfrag_block); } -static int ufs_readpage(struct dentry *dentry, struct page *page) +static int ufs_readpage(void *cookie, struct page *page) { return block_read_full_page(page,ufs_getfrag_block); } -static int ufs_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to) +static int ufs_prepare_write(void *cookie, struct page *page, unsigned from, unsigned to) { return block_prepare_write(page,from,to,ufs_getfrag_block); } diff -ur linux-orig/include/linux/fs.h linux/include/linux/fs.h --- linux-orig/include/linux/fs.h Wed May 3 15:47:40 2000 +++ linux/include/linux/fs.h Wed May 3 20:27:46 2000 @@ -338,11 +338,11 @@ struct address_space; struct address_space_operations { - int (*writepage)(struct file *, struct dentry *, struct page *); - int (*readpage)(struct dentry *, struct page *); - int (*sync_page)(struct page *); - int (*prepare_write)(struct file *, struct page *, unsigned, unsigned); - int (*commit_write)(struct file *, struct page *, unsigned, unsigned); + int (*writepage)(void *, struct page *); + int (*readpage)(void *, struct page *); + int (*sync_page)(void *, struct page *); + int (*prepare_write)(void *, struct page *, unsigned, unsigned); + int (*commit_write)(void *, struct page *, unsigned, unsigned); /* Unfortunately this kludge is needed for FIBMAP. Don't use it */ int (*bmap)(struct address_space *, long); }; @@ -1085,7 +1085,6 @@ extern int brw_page(int, struct page *, kdev_t, int [], int); -typedef int (*writepage_t)(struct file *, struct page *, unsigned long, unsigned long, const char *); typedef int (get_block_t)(struct inode*,long,struct buffer_head*,int); /* Generic buffer handling for block filesystems.. */ @@ -1097,10 +1096,10 @@ extern int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*); extern int cont_prepare_write(struct page*, unsigned, unsigned, get_block_t*, unsigned long *); -extern int block_sync_page(struct page *); +extern int block_sync_page(void *, struct page *); int generic_block_bmap(struct address_space *, long, get_block_t *); -int generic_commit_write(struct file *, struct page *, unsigned, unsigned); +int generic_commit_write(void *, struct page *, unsigned, unsigned); extern int generic_file_mmap(struct file *, struct vm_area_struct *); extern ssize_t generic_file_read(struct file *, char *, size_t, loff_t *); diff -ur linux-orig/include/linux/nfs_fs.h linux/include/linux/nfs_fs.h --- linux-orig/include/linux/nfs_fs.h Wed May 3 15:47:40 2000 +++ linux/include/linux/nfs_fs.h Wed May 3 19:39:02 2000 @@ -175,7 +175,7 @@ /* * linux/fs/nfs/write.c */ -extern int nfs_writepage(struct file *file, struct dentry *, struct page *); +extern int nfs_writepage(void *, struct page *); extern int nfs_flush_incompatible(struct file *file, struct page *page); extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); /* @@ -232,7 +232,7 @@ /* * linux/fs/nfs/read.c */ -extern int nfs_readpage(struct dentry *, struct page *); +extern int nfs_readpage(void *, struct page *); extern int nfs_pagein_inode(struct inode *, unsigned long, unsigned int); extern int nfs_pagein_timeout(struct inode *); diff -ur linux-orig/mm/filemap.c linux/mm/filemap.c --- linux-orig/mm/filemap.c Wed May 3 15:47:40 2000 +++ linux/mm/filemap.c Wed May 3 17:49:04 2000 @@ -83,7 +83,7 @@ struct address_space *mapping = page->mapping; if (mapping && mapping->a_ops && mapping->a_ops->sync_page) - return mapping->a_ops->sync_page(page); + return mapping->a_ops->sync_page(NULL, page); return 0; } @@ -584,7 +584,7 @@ return -ENOMEM; if (!add_to_page_cache_unique(page, mapping, offset, hash)) { - int error = mapping->a_ops->readpage(file->f_dentry, page); + int error = mapping->a_ops->readpage(file, page); page_cache_release(page); return error; } @@ -1119,7 +1119,7 @@ readpage: /* ... and start the actual read. The read will unlock the page. */ - error = mapping->a_ops->readpage(filp->f_dentry, page); + error = mapping->a_ops->readpage(filp, page); if (!error) { if (Page_Uptodate(page)) @@ -1501,7 +1501,7 @@ goto success; } - if (!mapping->a_ops->readpage(file->f_dentry, page)) { + if (!mapping->a_ops->readpage(file, page)) { wait_on_page(page); if (Page_Uptodate(page)) goto success; @@ -1519,7 +1519,7 @@ goto success; } ClearPageError(page); - if (!mapping->a_ops->readpage(file->f_dentry, page)) { + if (!mapping->a_ops->readpage(file, page)) { wait_on_page(page); if (Page_Uptodate(page)) goto success; @@ -1538,8 +1538,7 @@ struct page * page, int wait) { - struct dentry * dentry = file->f_dentry; - struct inode * inode = dentry->d_inode; + struct inode * inode = (struct inode*)page->mapping->host; /* * If a task terminates while we're swapping the page, the vma and @@ -1547,7 +1546,7 @@ * vma/file is guaranteed to exist in the unmap/sync cases because * mmap_sem is held. */ - return inode->i_mapping->a_ops->writepage(file, dentry, page); + return inode->i_mapping->a_ops->writepage(file, page); }