summaryrefslogtreecommitdiff
path: root/fs/f2fs/segment.c
diff options
context:
space:
mode:
authorDaeho Jeong <daehojeong@google.com>2022-07-19 02:02:48 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2022-07-31 06:17:07 +0300
commitf8e2f32bcde5945e8f8dbb8714178c24d221366b (patch)
treee9360e5772e2b6bc6d04a4c3c72f85a8f716a62b /fs/f2fs/segment.c
parent1adaa71ea9bff3a0ca0b37eabbb7f89225b595cb (diff)
downloadlinux-f8e2f32bcde5945e8f8dbb8714178c24d221366b.tar.xz
f2fs: introduce sysfs atomic write statistics
introduce the below 4 new sysfs node for atomic write statistics. - current_atomic_write: the total current atomic write block count, which is not committed yet. - peak_atomic_write: the peak value of total current atomic write block count after boot. - committed_atomic_block: the accumulated total committed atomic write block count after boot. - revoked_atomic_block: the accumulated total revoked atomic write block count after boot. Signed-off-by: Daeho Jeong <daehojeong@google.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r--fs/f2fs/segment.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 12b0edc48f7b..51da73b27a45 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -196,6 +196,7 @@ void f2fs_abort_atomic_write(struct inode *inode, bool clean)
clear_inode_flag(fi->cow_inode, FI_ATOMIC_FILE);
iput(fi->cow_inode);
fi->cow_inode = NULL;
+ release_atomic_write_cnt(inode);
clear_inode_flag(inode, FI_ATOMIC_FILE);
spin_lock(&sbi->inode_lock[ATOMIC_FILE]);
@@ -335,6 +336,11 @@ next:
}
out:
+ if (ret)
+ sbi->revoked_atomic_block += fi->atomic_write_cnt;
+ else
+ sbi->committed_atomic_block += fi->atomic_write_cnt;
+
__complete_revoke_list(inode, &revoke_list, ret ? true : false);
return ret;