summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/file.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-12-28 13:55:09 -0800
committerJaegeuk Kim <jaegeuk@kernel.org>2017-01-29 12:46:01 +0900
commit26a28a0c1eb756ba18bfb1f93309c4b4406b9cd9 (patch)
treeefacad1712cadc9258e021c9a107825a3872f04b /fs/f2fs/file.c
parentec91538dccd44329ad83d3aae1aa6a8389b5c75f (diff)
downloadlinux-26a28a0c1eb756ba18bfb1f93309c4b4406b9cd9.tar.bz2
f2fs: show the max number of atomic operations
This patch adds to show the max number of atomic operations which are conducting concurrently. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r--fs/f2fs/file.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 49f10dce817d..291d2ca53a4c 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -1542,6 +1542,8 @@ static int f2fs_ioc_start_atomic_write(struct file *filp)
if (ret)
clear_inode_flag(inode, FI_ATOMIC_FILE);
out:
+ stat_inc_atomic_write(inode);
+ stat_update_max_atomic_write(inode);
inode_unlock(inode);
mnt_drop_write_file(filp);
return ret;
@@ -1571,9 +1573,11 @@ static int f2fs_ioc_commit_atomic_write(struct file *filp)
set_inode_flag(inode, FI_ATOMIC_FILE);
goto err_out;
}
+ ret = f2fs_do_sync_file(filp, 0, LLONG_MAX, 0, true);
+ stat_dec_atomic_write(inode);
+ } else {
+ ret = f2fs_do_sync_file(filp, 0, LLONG_MAX, 0, true);
}
-
- ret = f2fs_do_sync_file(filp, 0, LLONG_MAX, 0, true);
err_out:
inode_unlock(inode);
mnt_drop_write_file(filp);