Lines Matching +full:count +full:- +full:threshold
1 /* SPDX-License-Identifier: GPL-2.0-only */
11 #include "dm-block-manager.h"
28 * Extensions do not appear in this count until after commit has
31 int (*get_nr_blocks)(struct dm_space_map *sm, dm_block_t *count);
38 * have blocks with a zero reference count that will not be
41 int (*get_nr_free)(struct dm_space_map *sm, dm_block_t *count);
46 int (*set_count)(struct dm_space_map *sm, dm_block_t b, uint32_t count);
67 * You can register one threshold callback which is edge-triggered
68 * when the free space in the space map drops below the threshold.
71 dm_block_t threshold,
76 /*----------------------------------------------------------------*/
81 sm->destroy(sm); in dm_sm_destroy()
86 return sm->extend(sm, extra_blocks); in dm_sm_extend()
89 static inline int dm_sm_get_nr_blocks(struct dm_space_map *sm, dm_block_t *count) in dm_sm_get_nr_blocks() argument
91 return sm->get_nr_blocks(sm, count); in dm_sm_get_nr_blocks()
94 static inline int dm_sm_get_nr_free(struct dm_space_map *sm, dm_block_t *count) in dm_sm_get_nr_free() argument
96 return sm->get_nr_free(sm, count); in dm_sm_get_nr_free()
102 return sm->get_count(sm, b, result); in dm_sm_get_count()
108 return sm->count_is_more_than_one(sm, b, result); in dm_sm_count_is_more_than_one()
112 uint32_t count) in dm_sm_set_count() argument
114 return sm->set_count(sm, b, count); in dm_sm_set_count()
119 return sm->commit(sm); in dm_sm_commit()
124 return sm->inc_blocks(sm, b, e); in dm_sm_inc_blocks()
134 return sm->dec_blocks(sm, b, e); in dm_sm_dec_blocks()
144 return sm->new_block(sm, b); in dm_sm_new_block()
149 return sm->root_size(sm, result); in dm_sm_root_size()
154 return sm->copy_root(sm, copy_to_here_le, len); in dm_sm_copy_root()
158 dm_block_t threshold, in dm_sm_register_threshold_callback() argument
162 if (sm->register_threshold_callback) in dm_sm_register_threshold_callback()
163 return sm->register_threshold_callback(sm, threshold, fn, context); in dm_sm_register_threshold_callback()
165 return -EINVAL; in dm_sm_register_threshold_callback()