summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk.kim@samsung.com>2013-10-31 06:57:01 +0100
committerJaegeuk Kim <jaegeuk.kim@samsung.com>2013-10-31 08:01:03 +0100
commitcfe58f9dcd9afe181894e2257e3f8aa3fee840c5 (patch)
tree1acd83b88bb0cb1aed28ffe3ae6091f69bd0f091 /fs/f2fs/file.c
parentf2fs: check all ones or zeros bitmap with bitops for better mount performance (diff)
downloadlinux-cfe58f9dcd9afe181894e2257e3f8aa3fee840c5.tar.xz
linux-cfe58f9dcd9afe181894e2257e3f8aa3fee840c5.zip
f2fs: avoid to wait all the node blocks during fsync
Previously, f2fs_sync_file() waits for all the node blocks to be written. But, we don't need to do that, but wait only the inode-related node blocks. This patch adds wait_on_node_pages_writeback() in which waits inode-related node blocks that are on writeback. Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r--fs/f2fs/file.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 58ed19aaa4c6..7d714f4972d5 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -189,8 +189,9 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
if (ret)
goto out;
}
- filemap_fdatawait_range(sbi->node_inode->i_mapping,
- 0, LONG_MAX);
+ ret = wait_on_node_pages_writeback(sbi, inode->i_ino);
+ if (ret)
+ goto out;
ret = blkdev_issue_flush(inode->i_sb->s_bdev, GFP_KERNEL, NULL);
}
out: