diff options
Diffstat (limited to 'fs/bcachefs/time_stats.c')
-rw-r--r-- | fs/bcachefs/time_stats.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/bcachefs/time_stats.c b/fs/bcachefs/time_stats.c index 4ac6ebfd264c..4508e9dcbee2 100644 --- a/fs/bcachefs/time_stats.c +++ b/fs/bcachefs/time_stats.c @@ -73,6 +73,8 @@ static inline void time_stats_update_one(struct bch2_time_stats *stats, bool initted = stats->last_event != 0; if (time_after64(end, start)) { + struct quantiles *quantiles = time_stats_to_quantiles(stats); + duration = end - start; mean_and_variance_update(&stats->duration_stats, duration); mean_and_variance_weighted_update(&stats->duration_stats_weighted, @@ -81,8 +83,8 @@ static inline void time_stats_update_one(struct bch2_time_stats *stats, stats->min_duration = min(stats->min_duration, duration); stats->total_duration += duration; - if (stats->quantiles_enabled) - quantiles_update(&stats->quantiles, duration); + if (quantiles) + quantiles_update(quantiles, duration); } if (stats->last_event && time_after64(end, stats->last_event)) { |