From: Yangtao Li Date: Wed, 21 Dec 2022 19:20:01 +0000 (+0800) Subject: f2fs: add iostat support for flush X-Git-Tag: v6.3-rc1~56^2~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=193a639fed92793ad10e327cfb2be7175be01425;p=thirdparty%2Fkernel%2Fstable.git f2fs: add iostat support for flush In this patch, it adds to account flush count. Signed-off-by: Yangtao Li Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index d4729f8af2478..331c330ea31dc 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1192,6 +1192,7 @@ enum iostat_type { /* other */ FS_DISCARD_IO, /* discard */ + FS_FLUSH_IO, /* flush */ NR_IO_TYPE, }; diff --git a/fs/f2fs/iostat.c b/fs/f2fs/iostat.c index acf834c772912..91b384bea5ac5 100644 --- a/fs/f2fs/iostat.c +++ b/fs/f2fs/iostat.c @@ -80,6 +80,7 @@ int __maybe_unused iostat_info_seq_show(struct seq_file *seq, void *offset) /* print other IOs */ seq_puts(seq, "[OTHER]\n"); IOSTAT_INFO_SHOW("fs discard", FS_DISCARD_IO); + IOSTAT_INFO_SHOW("fs flush", FS_FLUSH_IO); return 0; } diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 311243dda4cef..976316218bd3f 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -506,6 +506,8 @@ static int __submit_flush_wait(struct f2fs_sb_info *sbi, trace_f2fs_issue_flush(bdev, test_opt(sbi, NOBARRIER), test_opt(sbi, FLUSH_MERGE), ret); + if (!ret) + f2fs_update_iostat(sbi, NULL, FS_FLUSH_IO, 0); return ret; }