Lines Matching refs:t
33 static void threshold_init(struct threshold *t) in threshold_init() argument
35 t->threshold_set = false; in threshold_init()
36 t->value_set = false; in threshold_init()
39 static void set_threshold(struct threshold *t, dm_block_t value, in set_threshold() argument
42 t->threshold_set = true; in set_threshold()
43 t->threshold = value; in set_threshold()
44 t->fn = fn; in set_threshold()
45 t->context = context; in set_threshold()
48 static bool below_threshold(struct threshold *t, dm_block_t value) in below_threshold() argument
50 return t->threshold_set && value <= t->threshold; in below_threshold()
53 static bool threshold_already_triggered(struct threshold *t) in threshold_already_triggered() argument
55 return t->value_set && below_threshold(t, t->current_value); in threshold_already_triggered()
58 static void check_threshold(struct threshold *t, dm_block_t value) in check_threshold() argument
60 if (below_threshold(t, value) && in check_threshold()
61 !threshold_already_triggered(t)) in check_threshold()
62 t->fn(t->context); in check_threshold()
64 t->value_set = true; in check_threshold()
65 t->current_value = value; in check_threshold()