Skip to contentSkip to conversation

-mm: ocfs2: convert to new aops

PATCH New Mark Fasheh 1 participant 1 message Jun 20, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 -mm: ocfs2: convert to new aops

Plug ocfs2 into the ->write_begin and ->write_end aops.

A bunch of custom code is now gone - the iovec iteration stuff during write and the ocfs2 splice write actor.

---

 fs/ocfs2/aops.c |   14 ++-
 fs/ocfs2/aops.h |    8 --
 fs/ocfs2/file.c |  260 +++----------------------------------------------------
 3 files changed, 22 insertions(+), 260 deletions(-)

cebc6400c7900db2cf3d21274b87ddc27938bd75

fs/ocfs2/aops.c +8 -6
index 6cb5c4f..a81533e 100644
@@ -1476,9 +1476,9 @@ out:
 	return ret;
 }
 
-int ocfs2_write_begin(struct file *file, struct address_space *mapping,
-		      loff_t pos, unsigned len, unsigned flags,
-		      struct page **pagep, void **fsdata)
+static int ocfs2_write_begin(struct file *file, struct address_space *mapping,
+			     loff_t pos, unsigned len, unsigned flags,
+			     struct page **pagep, void **fsdata)
 {
 	int ret;
 	struct buffer_head *di_bh = NULL;
@@ -1596,9 +1596,9 @@ int ocfs2_write_end_nolock(struct addres
 	return copied;
 }
 
-int ocfs2_write_end(struct file *file, struct address_space *mapping,
-		    loff_t pos, unsigned len, unsigned copied,
-		    struct page *page, void *fsdata)
+static int ocfs2_write_end(struct file *file, struct address_space *mapping,
+			   loff_t pos, unsigned len, unsigned copied,
+			   struct page *page, void *fsdata)
 {
 	int ret;
 	struct inode *inode = mapping->host;
@@ -1615,6 +1615,8 @@ int ocfs2_write_end(struct file *file, s
 const struct address_space_operations ocfs2_aops = {
 	.readpage	= ocfs2_readpage,
 	.writepage	= ocfs2_writepage,
+	.write_begin	= ocfs2_write_begin,
+	.write_end	= ocfs2_write_end,
 	.bmap		= ocfs2_bmap,
 	.sync_page	= block_sync_page,
 	.direct_IO	= ocfs2_direct_IO,
fs/ocfs2/aops.h +0 -8
index 389579b..eb28dfe 100644
@@ -42,14 +42,6 @@ int walk_page_buffers(	handle_t *handle,
 			int (*fn)(	handle_t *handle,
 					struct buffer_head *bh));
 
-int ocfs2_write_begin(struct file *file, struct address_space *mapping,
-		      loff_t pos, unsigned len, unsigned flags,
-		      struct page **pagep, void **fsdata);
-
-int ocfs2_write_end(struct file *file, struct address_space *mapping,
-		    loff_t pos, unsigned len, unsigned copied,
-		    struct page *page, void *fsdata);
-
 int ocfs2_write_end_nolock(struct address_space *mapping,
 			   loff_t pos, unsigned len, unsigned copied,
 			   struct page *page, void *fsdata);
fs/ocfs2/file.c +14 -246

315 lines not on this page · raw message

Signature · 1 line
1.3.3