summaryrefslogtreecommitdiffstats
path: root/contrib/android/block_range.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 09:25:10 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 09:25:10 +0000
commit5dced3d1b3deca80e01415a2e35dc7972dcbfae7 (patch)
tree6a403684e0978f0287d7f0ec0e5aab1fd31a59e1 /contrib/android/block_range.h
parentInitial commit. (diff)
downloade2fsprogs-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.h29
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 */