summaryrefslogtreecommitdiff
path: root/fs/f2fs/checkpoint.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-07-14 05:33:19 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2016-07-16 01:21:23 +0300
commit9dfa1baff76d08843aaf5e3c78f6da6950957702 (patch)
tree72de844844bf3a78ed02ba11e36b405246bf8a0d /fs/f2fs/checkpoint.c
parent82e0a5aa5ddf794b3e1b21fcd091228736871882 (diff)
downloadlinux-9dfa1baff76d08843aaf5e3c78f6da6950957702.tar.xz
f2fs: use blk_plug in all the possible paths
This patch reverts 19a5f5e2ef37 (f2fs: drop any block plugging), and adds blk_plug in write paths additionally. The main reason is that blk_start_plug can be used to wake up from low-power mode before submitting further bios. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/checkpoint.c')
-rw-r--r--fs/f2fs/checkpoint.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 8ea895389ae4..be1c54b62388 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -265,6 +265,7 @@ static int f2fs_write_meta_pages(struct address_space *mapping,
struct writeback_control *wbc)
{
struct f2fs_sb_info *sbi = F2FS_M_SB(mapping);
+ struct blk_plug plug;
long diff, written;
/* collect a number of dirty meta pages and write together */
@@ -277,7 +278,9 @@ static int f2fs_write_meta_pages(struct address_space *mapping,
/* if mounting is failed, skip writing node pages */
mutex_lock(&sbi->cp_mutex);
diff = nr_pages_to_write(sbi, META, wbc);
+ blk_start_plug(&plug);
written = sync_meta_pages(sbi, META, wbc->nr_to_write);
+ blk_finish_plug(&plug);
mutex_unlock(&sbi->cp_mutex);
wbc->nr_to_write = max((long)0, wbc->nr_to_write - written - diff);
return 0;
@@ -899,8 +902,11 @@ static int block_operations(struct f2fs_sb_info *sbi)
.nr_to_write = LONG_MAX,
.for_reclaim = 0,
};
+ struct blk_plug plug;
int err = 0;
+ blk_start_plug(&plug);
+
retry_flush_dents:
f2fs_lock_all(sbi);
/* write all the dirty dentry pages */
@@ -937,6 +943,7 @@ retry_flush_nodes:
goto retry_flush_nodes;
}
out:
+ blk_finish_plug(&plug);
return err;
}