diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-05-01 14:21:01 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2018-05-01 16:49:42 -0400 |
commit | c81f0b722fe7cdede89b514fe8c0432ec07af048 (patch) | |
tree | 513ff49f6d96733a86ca885cd06280cb4bd369e2 /fs/bcachefs/util.h | |
parent | 7609e7fa650e0ccc3de002423cbd5bcd3165bf6c (diff) |
bcachefs: Don't promote when target is congestedpromote
Diffstat (limited to 'fs/bcachefs/util.h')
-rw-r--r-- | fs/bcachefs/util.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/fs/bcachefs/util.h b/fs/bcachefs/util.h index 97e4e6d00a37..7c7264f4f595 100644 --- a/fs/bcachefs/util.h +++ b/fs/bcachefs/util.h @@ -372,6 +372,9 @@ ssize_t bch2_scnprint_flag_list(char *, size_t, const char * const[], u64); u64 bch2_read_flag_list(char *, const char * const[]); #define NR_QUANTILES 15 +#define QUANTILE_IDX(i) inorder_to_eytzinger0(i, NR_QUANTILES) +#define QUANTILE_FIRST eytzinger0_first(NR_QUANTILES) +#define QUANTILE_LAST eytzinger0_last(NR_QUANTILES) struct quantiles { struct quantile_entry { @@ -401,7 +404,13 @@ struct time_stats { struct time_stat_buffer __percpu *buffer; }; -void bch2_time_stats_update(struct time_stats *stats, u64 time); +void __bch2_time_stats_update(struct time_stats *stats, u64, u64); + +static inline void bch2_time_stats_update(struct time_stats *stats, u64 start) +{ + __bch2_time_stats_update(stats, start, local_clock()); +} + size_t bch2_time_stats_print(struct time_stats *, char *, size_t); void bch2_time_stats_exit(struct time_stats *); |