summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorDaeho Jeong <daehojeong@google.com>2021-08-19 20:52:28 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2021-08-23 10:25:51 -0700
commit521187439abfb3e1c946796dc2187c443e5457ab (patch)
treefce6c67e0ba999bb4ab8f3463dccf8f005c77be5 /fs/f2fs/super.c
parentbbe1da7e34ac5a830163bfdfa09cbe3dadfda3ce (diff)
downloadlinux-521187439abfb3e1c946796dc2187c443e5457ab.tar.gz
linux-521187439abfb3e1c946796dc2187c443e5457ab.tar.bz2
linux-521187439abfb3e1c946796dc2187c443e5457ab.zip
f2fs: separate out iostat feature
Added F2FS_IOSTAT config option to support getting IO statistics through sysfs and printing out periodic IO statistics tracepoint events and moved I/O statistics related codes into separate files for better maintenance. Signed-off-by: Daeho Jeong <daehojeong@google.com> Reviewed-by: Chao Yu <chao@kernel.org> [Jaegeuk Kim: set default=y] Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r--fs/f2fs/super.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index b556ca38f0fb..a23926d1a77b 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -33,6 +33,7 @@
#include "segment.h"
#include "xattr.h"
#include "gc.h"
+#include "iostat.h"
#define CREATE_TRACE_POINTS
#include <trace/events/f2fs.h>
@@ -3964,11 +3965,6 @@ try_onemore:
set_sbi_flag(sbi, SBI_POR_DOING);
spin_lock_init(&sbi->stat_lock);
- /* init iostat info */
- spin_lock_init(&sbi->iostat_lock);
- sbi->iostat_enable = false;
- sbi->iostat_period_ms = DEFAULT_IOSTAT_PERIOD_MS;
-
for (i = 0; i < NR_PAGE_TYPE; i++) {
int n = (i == META) ? 1 : NR_TEMP_TYPE;
int j;
@@ -3999,6 +3995,10 @@ try_onemore:
init_waitqueue_head(&sbi->cp_wait);
init_sb_info(sbi);
+ err = f2fs_init_iostat(sbi);
+ if (err)
+ goto free_bio_info;
+
err = init_percpu_info(sbi);
if (err)
goto free_bio_info;