aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2014-07-24 22:11:43 -0400
committerJaegeuk Kim <jaegeuk@kernel.org>2014-07-30 17:13:23 -0400
commitea1aa12ca237149227ef68af50c9a1acf027b625 (patch)
tree12ac50b385998668bc2978e0949897e071b43ea3 /fs/f2fs/file.c
parent6d99ba41a72c1213f2029e6fc66aa7943339b5db (diff)
f2fs: enable in-place-update for fdatasync
This patch enforces in-place-updates only when fdatasync is requested. If we adopt this in-place-updates for the fdatasync, we can skip to write the recovery information. Reviewed-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r--fs/f2fs/file.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 9b888fbf08b6..95501358932c 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -127,7 +127,14 @@ int f2fs_sync_file(struct file *file, loff_t start, loff_t end, int datasync)
127 return 0; 127 return 0;
128 128
129 trace_f2fs_sync_file_enter(inode); 129 trace_f2fs_sync_file_enter(inode);
130
131 /* if fdatasync is triggered, let's do in-place-update */
132 if (datasync)
133 set_inode_flag(fi, FI_NEED_IPU);
134
130 ret = filemap_write_and_wait_range(inode->i_mapping, start, end); 135 ret = filemap_write_and_wait_range(inode->i_mapping, start, end);
136 if (datasync)
137 clear_inode_flag(fi, FI_NEED_IPU);
131 if (ret) { 138 if (ret) {
132 trace_f2fs_sync_file_exit(inode, need_cp, datasync, ret); 139 trace_f2fs_sync_file_exit(inode, need_cp, datasync, ret);
133 return ret; 140 return ret;