aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext4/inode.c
diff options
context:
space:
mode:
authorShaohua Li <shaohua.li@intel.com>2011-10-18 10:55:51 -0400
committerTheodore Ts'o <tytso@mit.edu>2011-10-18 10:55:51 -0400
commit1bce63d1a2a2c8929442b79acd4eab2e3db10a0b (patch)
tree2dfdd7f28440bca2ba5932c708f541c8a6a21d06 /fs/ext4/inode.c
parentf6f96fdb8c2779f9bd8ed7b0b08405b4439c982b (diff)
ext4: add block plug for .writepages
Add block plug for ext4 .writepages. Though ext4 .writepages already handles request merge very well, block plug is still helpful to reduce block lock contention. Signed-off-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r--fs/ext4/inode.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 4863238c3754..081bb25a9ad3 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -2160,6 +2160,7 @@ static int ext4_da_writepages(struct address_space *mapping,
2160 struct ext4_sb_info *sbi = EXT4_SB(mapping->host->i_sb); 2160 struct ext4_sb_info *sbi = EXT4_SB(mapping->host->i_sb);
2161 pgoff_t done_index = 0; 2161 pgoff_t done_index = 0;
2162 pgoff_t end; 2162 pgoff_t end;
2163 struct blk_plug plug;
2163 2164
2164 trace_ext4_da_writepages(inode, wbc); 2165 trace_ext4_da_writepages(inode, wbc);
2165 2166
@@ -2238,6 +2239,7 @@ retry:
2238 if (wbc->sync_mode == WB_SYNC_ALL || wbc->tagged_writepages) 2239 if (wbc->sync_mode == WB_SYNC_ALL || wbc->tagged_writepages)
2239 tag_pages_for_writeback(mapping, index, end); 2240 tag_pages_for_writeback(mapping, index, end);
2240 2241
2242 blk_start_plug(&plug);
2241 while (!ret && wbc->nr_to_write > 0) { 2243 while (!ret && wbc->nr_to_write > 0) {
2242 2244
2243 /* 2245 /*
@@ -2302,6 +2304,7 @@ retry:
2302 */ 2304 */
2303 break; 2305 break;
2304 } 2306 }
2307 blk_finish_plug(&plug);
2305 if (!io_done && !cycled) { 2308 if (!io_done && !cycled) {
2306 cycled = 1; 2309 cycled = 1;
2307 index = 0; 2310 index = 0;