diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-07-13 19:33:19 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-07-15 15:21:23 -0700 |
commit | 9dfa1baff76d08843aaf5e3c78f6da6950957702 (patch) | |
tree | 72de844844bf3a78ed02ba11e36b405246bf8a0d /fs/f2fs/file.c | |
parent | 82e0a5aa5ddf794b3e1b21fcd091228736871882 (diff) | |
download | lwn-9dfa1baff76d08843aaf5e3c78f6da6950957702.tar.gz lwn-9dfa1baff76d08843aaf5e3c78f6da6950957702.zip |
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/file.c')
-rw-r--r-- | fs/f2fs/file.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 72e52cd15b60..47f1f5e36d1c 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -2102,6 +2102,7 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from) { struct file *file = iocb->ki_filp; struct inode *inode = file_inode(file); + struct blk_plug plug; ssize_t ret; if (f2fs_encrypted_inode(inode) && @@ -2113,8 +2114,11 @@ static ssize_t f2fs_file_write_iter(struct kiocb *iocb, struct iov_iter *from) ret = generic_write_checks(iocb, from); if (ret > 0) { ret = f2fs_preallocate_blocks(iocb, from); - if (!ret) + if (!ret) { + blk_start_plug(&plug); ret = __generic_file_write_iter(iocb, from); + blk_finish_plug(&plug); + } } inode_unlock(inode); |