From 464df1d5e5ab1322e2dd0a7796939fff1aeefa9a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 17:49:25 +0200 Subject: Adding upstream version 1.47.0. Signed-off-by: Daniel Baumann --- contrib/android/block_range.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 contrib/android/block_range.h (limited to 'contrib/android/block_range.h') diff --git a/contrib/android/block_range.h b/contrib/android/block_range.h new file mode 100644 index 0000000..cf7971e --- /dev/null +++ b/contrib/android/block_range.h @@ -0,0 +1,29 @@ +#ifndef BLOCK_RANGE_H +# define BLOCK_RANGE_H + +# include +# include + +struct block_range { + blk64_t start; + blk64_t end; + struct block_range *next; +}; + +struct block_range_list { + struct block_range *head; + struct block_range *tail; +}; + +void add_blocks_to_range(struct block_range_list *list, blk64_t blk_start, + blk64_t blk_end); +void delete_block_ranges(struct block_range_list *list); +int write_block_ranges(FILE *f, struct block_range *range, char *sep); + +/* + * Given a non-empty range list, return the next block and remove it from the + * list. + */ +blk64_t consume_next_block(struct block_range_list *list); + +#endif /* !BLOCK_RANGE_H */ -- cgit v1.2.3