>From 211d733fa0219d0f032f6ef7b48eb5513ffea39e Mon Sep 17 00:00:00 2001
From: Steven Whitehouse <[email protected]>
Date: Fri, 14 Dec 2012 17:57:34 +0000
Subject: GFS2: Use mpage_writepages() for both ordered and writeback modes

For some reason the ordered mode was still using generic_writepages()
rather than mpage_writepages(). This patch fixes that oversight.

Signed-off-by: Steven Whitehouse <[email protected]>

diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c
index 92340dd..24f414f 100644
--- a/fs/gfs2/aops.c
+++ b/fs/gfs2/aops.c
@@ -230,16 +230,14 @@ out_ignore:
 }
 
 /**
- * gfs2_writeback_writepages - Write a bunch of dirty pages back to disk
+ * gfs2_writepages - Write a bunch of dirty pages back to disk
  * @mapping: The mapping to write
  * @wbc: Write-back control
  *
- * For the data=writeback case we can already ignore buffer heads
- * and write whole extents at once. This is a big reduction in the
- * number of I/O requests we send and the bmap calls we make in this case.
+ * Used for both ordered and writeback modes.
  */
-static int gfs2_writeback_writepages(struct address_space *mapping,
-                                    struct writeback_control *wbc)
+static int gfs2_writepages(struct address_space *mapping,
+                          struct writeback_control *wbc)
 {
        return mpage_writepages(mapping, wbc, gfs2_get_block_noalloc);
 }
@@ -1102,7 +1100,7 @@ cannot_release:
 
 static const struct address_space_operations gfs2_writeback_aops = {
        .writepage = gfs2_writeback_writepage,
-       .writepages = gfs2_writeback_writepages,
+       .writepages = gfs2_writepages,
        .readpage = gfs2_readpage,
        .readpages = gfs2_readpages,
        .write_begin = gfs2_write_begin,
@@ -1118,6 +1116,7 @@ static const struct address_space_operations 
gfs2_writeback_aops = {
 
 static const struct address_space_operations gfs2_ordered_aops = {
        .writepage = gfs2_ordered_writepage,
+       .writepages = gfs2_writepages,
        .readpage = gfs2_readpage,
        .readpages = gfs2_readpages,
        .write_begin = gfs2_write_begin,
-- 
1.7.4



Reply via email to