dm bitset: introduce cursor api
Signed-off-by: Joe Thornber <ejt@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
This commit is contained in:
committed by
Mike Snitzer
parent
9f9ef0657d
commit
6fe28dbf05
@@ -161,6 +161,28 @@ int dm_bitset_test_bit(struct dm_disk_bitset *info, dm_block_t root,
|
||||
int dm_bitset_flush(struct dm_disk_bitset *info, dm_block_t root,
|
||||
dm_block_t *new_root);
|
||||
|
||||
struct dm_bitset_cursor {
|
||||
struct dm_disk_bitset *info;
|
||||
struct dm_array_cursor cursor;
|
||||
|
||||
uint32_t entries_remaining;
|
||||
uint32_t array_index;
|
||||
uint32_t bit_index;
|
||||
uint64_t current_bits;
|
||||
};
|
||||
|
||||
/*
|
||||
* Make sure you've flush any dm_disk_bitset and updated the root before
|
||||
* using this.
|
||||
*/
|
||||
int dm_bitset_cursor_begin(struct dm_disk_bitset *info,
|
||||
dm_block_t root, uint32_t nr_entries,
|
||||
struct dm_bitset_cursor *c);
|
||||
void dm_bitset_cursor_end(struct dm_bitset_cursor *c);
|
||||
|
||||
int dm_bitset_cursor_next(struct dm_bitset_cursor *c);
|
||||
bool dm_bitset_cursor_get_value(struct dm_bitset_cursor *c);
|
||||
|
||||
/*----------------------------------------------------------------*/
|
||||
|
||||
#endif /* _LINUX_DM_BITSET_H */
|
||||
|
||||
Reference in New Issue
Block a user