[PATCH] AFS: Convert to new write aops

Previous thread: ext3 read only handling by Pavel Machek on Thursday, September 25, 2008 - 8:03 am. (2 messages)

Next thread: 2.6.26.5 hangs on boot by Stephen Clark on Thursday, September 25, 2008 - 8:25 am. (2 messages)
From: David Howells
Date: Thursday, September 25, 2008 - 8:01 am

From: Nick Piggin <npiggin@suse.de>

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 <npiggin@suse.de>
Signed-off-by: David Howells <dhowells@redhat.com>
---

 fs/afs/file.c     |    4 +-
 fs/afs/internal.h |    8 ++-
 fs/afs/write.c    |  131 +++++++++++++++++------------------------------------
 3 files changed, 51 insertions(+), 92 deletions(-)


diff --git a/fs/afs/file.c b/fs/afs/file.c
index 8e24e96..909083d 100644
--- a/fs/afs/file.c
+++ b/fs/afs/file.c
@@ -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,
 };
diff --git a/fs/afs/internal.h b/fs/afs/internal.h
index 979eb1d..a7f81cc 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -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 ...
Previous thread: ext3 read only handling by Pavel Machek on Thursday, September 25, 2008 - 8:03 am. (2 messages)

Next thread: 2.6.26.5 hangs on boot by Stephen Clark on Thursday, September 25, 2008 - 8:25 am. (2 messages)