From 68e37e56760edd7959ff1f8194ea7ed799f731c1 Mon Sep 17 00:00:00 2001 From: Tomohiro Kusumi Date: Sat, 5 Aug 2023 23:12:28 -0700 Subject: [PATCH] sys/vfs/hammer2: Fix double count of hammer2_iod_file_{read,write} These two are double counting data chain read / write. * The strategy read lookups a data chain and ends up calling hammer2_adjreadcounter() from hammer2_chain_load_data(). * The strategy write ends up calling hammer2_adjwritecounter() when a dirty dio is putblk'd. Also note that hammer2_iod_xxx counters are for total I/O bytes according to functions above, not number of times called. --- sys/vfs/hammer2/hammer2_strategy.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/sys/vfs/hammer2/hammer2_strategy.c b/sys/vfs/hammer2/hammer2_strategy.c index ca2b9d5824..9f723d871a 100644 --- a/sys/vfs/hammer2/hammer2_strategy.c +++ b/sys/vfs/hammer2/hammer2_strategy.c @@ -99,11 +99,9 @@ hammer2_vop_strategy(struct vop_strategy_args *ap) switch(bp->b_cmd) { case BUF_CMD_READ: error = hammer2_strategy_read(ap); - ++hammer2_iod_file_read; break; case BUF_CMD_WRITE: error = hammer2_strategy_write(ap); - ++hammer2_iod_file_write; break; default: bp->b_error = error = EINVAL; -- 2.11.4.GIT