ext4_utils: export make_ext4fs_sparse_fd
Export a function to create a sparse image, writing the output to
an fd. Useful for utilities that need to format a partition.
Change-Id: I3737c65c69b7df0a0bd25885ee70aaadef8a4ad5
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c
index 64fcc84..5717912 100644
--- a/ext4_utils/make_ext4fs.c
+++ b/ext4_utils/make_ext4fs.c
@@ -353,6 +353,15 @@
}
}
+int make_ext4fs_sparse_fd(int fd, s64 len,
+ const char *mountpoint, struct selabel_handle *sehnd)
+{
+ reset_ext4fs_info();
+ info.len = len;
+
+ return make_ext4fs_internal(fd, NULL, mountpoint, NULL, 0, 1, 0, 0, 0, sehnd);
+}
+
int make_ext4fs(const char *filename, s64 len,
const char *mountpoint, struct selabel_handle *sehnd)
{