diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 09:25:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 09:25:10 +0000 |
commit | 5dced3d1b3deca80e01415a2e35dc7972dcbfae7 (patch) | |
tree | 6a403684e0978f0287d7f0ec0e5aab1fd31a59e1 /contrib/android/block_range.h | |
parent | Initial commit. (diff) | |
download | e2fsprogs-5dced3d1b3deca80e01415a2e35dc7972dcbfae7.tar.xz e2fsprogs-5dced3d1b3deca80e01415a2e35dc7972dcbfae7.zip |
Adding upstream version 1.47.0.upstream/1.47.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'contrib/android/block_range.h')
-rw-r--r-- | contrib/android/block_range.h | 29 |
1 files changed, 29 insertions, 0 deletions
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 <sys/types.h> +# include <ext2fs/ext2fs.h> + +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 */ |