• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef BLOCK_RANGE_H
2 # define BLOCK_RANGE_H
3 
4 # include <sys/types.h>
5 # include <ext2fs/ext2fs.h>
6 
7 struct block_range {
8 	blk64_t start;
9 	blk64_t end;
10 	struct block_range *next;
11 };
12 
13 struct block_range_list {
14 	struct block_range *head;
15 	struct block_range *tail;
16 };
17 
18 void add_blocks_to_range(struct block_range_list *list, blk64_t blk_start,
19 			 blk64_t blk_end);
20 void delete_block_ranges(struct block_range_list *list);
21 int write_block_ranges(FILE *f, struct block_range *range, char *sep);
22 
23 /*
24  * Given a non-empty range list, return the next block and remove it from the
25  * list.
26  */
27 blk64_t consume_next_block(struct block_range_list *list);
28 
29 #endif /* !BLOCK_RANGE_H */
30