Merge "Add _directory function for fd-based ext4 filesystem creation"
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c
index 59d9c3e..a9549a5 100644
--- a/ext4_utils/make_ext4fs.c
+++ b/ext4_utils/make_ext4fs.c
@@ -401,10 +401,19 @@
int make_ext4fs_sparse_fd(int fd, long long len,
const char *mountpoint, struct selabel_handle *sehnd)
{
+ return make_ext4fs_sparse_fd_directory(fd, len, mountpoint, sehnd, NULL);
+}
+
+int make_ext4fs_sparse_fd_directory(int fd, long long len,
+ const char *mountpoint, struct selabel_handle *sehnd,
+ const char *directory)
+{
reset_ext4fs_info();
info.len = len;
- return make_ext4fs_internal(fd, NULL, NULL, mountpoint, NULL, 0, 1, 0, 0, 0, sehnd, 0, -1, NULL);
+ return make_ext4fs_internal(fd, directory, NULL, mountpoint, NULL,
+ 0, 1, 0, 0, 0,
+ sehnd, 0, -1, NULL);
}
int make_ext4fs(const char *filename, long long len,
@@ -415,7 +424,7 @@
int make_ext4fs_directory(const char *filename, long long len,
const char *mountpoint, struct selabel_handle *sehnd,
- const char *directory)
+ const char *directory)
{
int fd;
int status;
@@ -429,7 +438,9 @@
return EXIT_FAILURE;
}
- status = make_ext4fs_internal(fd, directory, NULL, mountpoint, NULL, 0, 0, 0, 1, 0, sehnd, 0, -1, NULL);
+ status = make_ext4fs_internal(fd, directory, NULL, mountpoint, NULL,
+ 0, 0, 0, 1, 0,
+ sehnd, 0, -1, NULL);
close(fd);
return status;
diff --git a/ext4_utils/make_ext4fs.h b/ext4_utils/make_ext4fs.h
index 2573a0d..4498e62 100644
--- a/ext4_utils/make_ext4fs.h
+++ b/ext4_utils/make_ext4fs.h
@@ -30,6 +30,9 @@
const char *directory);
int make_ext4fs_sparse_fd(int fd, long long len,
const char *mountpoint, struct selabel_handle *sehnd);
+int make_ext4fs_sparse_fd_directory(int fd, long long len,
+ const char *mountpoint, struct selabel_handle *sehnd,
+ const char *directory);
#ifdef __cplusplus
}