AFS: Convert to new write aops
David Howells
maintainerPATCH 1/1 AFS: Convert to new write aops
From: Nick Piggin <[email protected]>
Convert AFS to the new write address space operations.
This cannot assume that writes will fully complete, so this conversion goes the easy way and always brings the page uptodate before the write.
Signed-off-by Nick Piggin <[email protected]>
Signed-off-by David Howells <[email protected]>
---
fs/afs/file.c | 4 +- fs/afs/internal.h | 8 ++- fs/afs/write.c | 131 +++++++++++++++++------------------------------------ 3 files changed, 51 insertions(+), 92 deletions(-)
fs/afs/file.c +2 -2
@@ -55,8 +55,8 @@ const struct address_space_operations afs_fs_aops = { .launder_page = afs_launder_page, .releasepage = afs_releasepage, .invalidatepage = afs_invalidatepage, - .prepare_write = afs_prepare_write, - .commit_write = afs_commit_write, + .write_begin = afs_write_begin, + .write_end = afs_write_end, .writepage = afs_writepage, .writepages = afs_writepages, };
fs/afs/internal.h +6 -2
@@ -722,8 +722,12 @@ extern int afs_volume_release_fileserver(struct afs_vnode *,*/ extern int afs_set_page_dirty (struct page *);extern void afs_put_writeback (struct afs_writeback *); -extern int afs_prepare_write (struct file *,struct page *,unsigned ,unsigned ); -extern int afs_commit_write (struct file *,struct page *,unsigned ,unsigned ); +extern int afs_write_begin (struct file *file,struct address_space *mapping, +loff_t pos,unsigned len,unsigned flags, +struct page **pagep,void **fsdata); +extern int afs_write_end (struct file *file,struct address_space *mapping, +loff_t pos,unsigned len,unsigned copied, +struct page *page,void *fsdata);extern int afs_writepage (struct page *,struct writeback_control *);extern int afs_writepages (struct address_space *,struct writeback_control *);extern int afs_write_inode (struct inode *,int );
fs/afs/write.c +43 -88
204 lines not on this page · raw message