diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-12-23 23:08:45 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-05 23:24:19 -0500 |
commit | 83322e8ca8b687528765d7f4acf55ef3855004c4 (patch) | |
tree | c72bf8d2cde850eb4a2b5e15cc758ac9b5876b4d /fs/bcachefs/btree_locking.h | |
parent | 0d529663f04be744d6af879889c5b16e46286ce1 (diff) | |
download | lwn-83322e8ca8b687528765d7f4acf55ef3855004c4.tar.gz lwn-83322e8ca8b687528765d7f4acf55ef3855004c4.zip |
bcachefs: btree_trans always has stats
reserve slot 0 for unknown (when we overflow), to avoid some branches
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_locking.h')
-rw-r--r-- | fs/bcachefs/btree_locking.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/bcachefs/btree_locking.h b/fs/bcachefs/btree_locking.h index 64810ea544c9..cc5500a957a1 100644 --- a/fs/bcachefs/btree_locking.h +++ b/fs/bcachefs/btree_locking.h @@ -122,12 +122,9 @@ static void btree_trans_lock_hold_time_update(struct btree_trans *trans, struct btree_path *path, unsigned level) { #ifdef CONFIG_BCACHEFS_LOCK_TIME_STATS - struct btree_transaction_stats *s = btree_trans_stats(trans); - - if (s) - __bch2_time_stats_update(&s->lock_hold_times, - path->l[level].lock_taken_time, - local_clock()); + __bch2_time_stats_update(&btree_trans_stats(trans)->lock_hold_times, + path->l[level].lock_taken_time, + local_clock()); #endif } |