summaryrefslogtreecommitdiff
path: root/fs/f2fs/iostat.c
diff options
context:
space:
mode:
authorYangtao Li <frank.li@vivo.com>2022-12-22 11:18:55 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2023-01-31 00:23:51 +0300
commitc5f9db2548d0ac988df81aa34cc63f3b2ed374f9 (patch)
tree90b6f5175bd5a62fd09ce21e60bb52f4a4d5e86f /fs/f2fs/iostat.c
parent193a639fed92793ad10e327cfb2be7175be01425 (diff)
downloadlinux-c5f9db2548d0ac988df81aa34cc63f3b2ed374f9.tar.xz
f2fs: drop useless initializer and unneeded local variable
No need to initialize idx twice. BTW, remove the unnecessary cnt variable. Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/iostat.c')
-rw-r--r--fs/f2fs/iostat.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/fs/f2fs/iostat.c b/fs/f2fs/iostat.c
index 91b384bea5ac..ed8176939aa5 100644
--- a/fs/f2fs/iostat.c
+++ b/fs/f2fs/iostat.c
@@ -87,8 +87,7 @@ int __maybe_unused iostat_info_seq_show(struct seq_file *seq, void *offset)
static inline void __record_iostat_latency(struct f2fs_sb_info *sbi)
{
- int io, idx = 0;
- unsigned int cnt;
+ int io, idx;
struct f2fs_iostat_latency iostat_lat[MAX_IO_TYPE][NR_PAGE_TYPE];
struct iostat_lat_info *io_lat = sbi->iostat_io_lat;
unsigned long flags;
@@ -96,12 +95,11 @@ static inline void __record_iostat_latency(struct f2fs_sb_info *sbi)
spin_lock_irqsave(&sbi->iostat_lat_lock, flags);
for (idx = 0; idx < MAX_IO_TYPE; idx++) {
for (io = 0; io < NR_PAGE_TYPE; io++) {
- cnt = io_lat->bio_cnt[idx][io];
iostat_lat[idx][io].peak_lat =
jiffies_to_msecs(io_lat->peak_lat[idx][io]);
- iostat_lat[idx][io].cnt = cnt;
- iostat_lat[idx][io].avg_lat = cnt ?
- jiffies_to_msecs(io_lat->sum_lat[idx][io]) / cnt : 0;
+ iostat_lat[idx][io].cnt = io_lat->bio_cnt[idx][io];
+ iostat_lat[idx][io].avg_lat = iostat_lat[idx][io].cnt ?
+ jiffies_to_msecs(io_lat->sum_lat[idx][io]) / iostat_lat[idx][io].cnt : 0;
io_lat->sum_lat[idx][io] = 0;
io_lat->peak_lat[idx][io] = 0;
io_lat->bio_cnt[idx][io] = 0;