f2fs: use atomic_t to record hit ratio info of extent cache
Variables for recording extent cache ratio info were updated without
protection, this patch tries to alter them to atomic_t type for more
accurate stat.
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
diff --git a/fs/f2fs/extent_cache.c b/fs/f2fs/extent_cache.c
index 5f78fc1..362df8c 100644
--- a/fs/f2fs/extent_cache.c
+++ b/fs/f2fs/extent_cache.c
@@ -279,7 +279,7 @@
et->largest.fofs + et->largest.len > pgofs) {
*ei = et->largest;
ret = true;
- stat_inc_read_hit(sbi->sb);
+ stat_inc_read_hit(sbi);
goto out;
}
@@ -292,10 +292,10 @@
et->cached_en = en;
spin_unlock(&sbi->extent_lock);
ret = true;
- stat_inc_read_hit(sbi->sb);
+ stat_inc_read_hit(sbi);
}
out:
- stat_inc_total_hit(sbi->sb);
+ stat_inc_total_hit(sbi);
read_unlock(&et->lock);
trace_f2fs_lookup_extent_tree_end(inode, pgofs, ei);