am 72acd484: Merge "ext4_utils: reduce exported apis"
# Via Colin Cross (1) and Gerrit Code Review (1)
* commit '72acd48419ab568647552fb0d7d6ed376f75d4da':
ext4_utils: reduce exported apis
diff --git a/ext4_utils/ext4_utils.h b/ext4_utils/ext4_utils.h
index cad2eae..520b356 100644
--- a/ext4_utils/ext4_utils.h
+++ b/ext4_utils/ext4_utils.h
@@ -167,6 +167,16 @@
u64 parse_num(const char *arg);
void ext4_parse_sb(struct ext4_super_block *sb);
+typedef void (*fs_config_func_t)(const char *path, int dir, unsigned *uid, unsigned *gid,
+ unsigned *mode);
+
+struct selabel_handle;
+
+int make_ext4fs_internal(int fd, const char *directory,
+ const char *mountpoint, fs_config_func_t fs_config_func, int gzip,
+ int sparse, int crc, int wipe, int init_itabs,
+ struct selabel_handle *sehnd);
+
#ifdef __cplusplus
}
#endif
diff --git a/ext4_utils/make_ext4fs.c b/ext4_utils/make_ext4fs.c
index 5717912..e69b473 100644
--- a/ext4_utils/make_ext4fs.c
+++ b/ext4_utils/make_ext4fs.c
@@ -59,6 +59,10 @@
#else
+#include <selinux/selinux.h>
+#include <selinux/label.h>
+#include <selinux/android.h>
+
#define O_BINARY 0
#endif
@@ -353,7 +357,7 @@
}
}
-int make_ext4fs_sparse_fd(int fd, s64 len,
+int make_ext4fs_sparse_fd(int fd, long long len,
const char *mountpoint, struct selabel_handle *sehnd)
{
reset_ext4fs_info();
@@ -362,7 +366,7 @@
return make_ext4fs_internal(fd, NULL, mountpoint, NULL, 0, 1, 0, 0, 0, sehnd);
}
-int make_ext4fs(const char *filename, s64 len,
+int make_ext4fs(const char *filename, long long len,
const char *mountpoint, struct selabel_handle *sehnd)
{
int fd;
diff --git a/ext4_utils/make_ext4fs.h b/ext4_utils/make_ext4fs.h
index d75ea02..3784a9e 100644
--- a/ext4_utils/make_ext4fs.h
+++ b/ext4_utils/make_ext4fs.h
@@ -17,33 +17,16 @@
#ifndef _MAKE_EXT4FS_H_
#define _MAKE_EXT4FS_H_
-#include "ext4_utils.h"
-#include "ext4.h"
-
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef USE_MINGW
-#include <selinux/selinux.h>
-#include <selinux/label.h>
-#include <selinux/android.h>
-#else
struct selabel_handle;
-#endif
-typedef void (*fs_config_func_t)(const char *path, int dir, unsigned *uid, unsigned *gid,
- unsigned *mode);
-
-void reset_ext4fs_info();
-int make_ext4fs(const char *filename, s64 len,
+int make_ext4fs(const char *filename, long long len,
const char *mountpoint, struct selabel_handle *sehnd);
-int make_ext4fs_sparse_fd(int fd, s64 len,
+int make_ext4fs_sparse_fd(int fd, long long len,
const char *mountpoint, struct selabel_handle *sehnd);
-int make_ext4fs_internal(int fd, const char *directory,
- const char *mountpoint, fs_config_func_t fs_config_func, int gzip,
- int sparse, int crc, int wipe, int init_itabs,
- struct selabel_handle *sehnd);
#ifdef __cplusplus
}
diff --git a/ext4_utils/make_ext4fs_main.c b/ext4_utils/make_ext4fs_main.c
index 3f6d35b..71fc3c1 100644
--- a/ext4_utils/make_ext4fs_main.c
+++ b/ext4_utils/make_ext4fs_main.c
@@ -16,6 +16,7 @@
#include <fcntl.h>
#include <libgen.h>
+#include <stdio.h>
#include <unistd.h>
#if defined(__linux__)
@@ -28,7 +29,16 @@
#include <private/android_filesystem_config.h>
#endif
+#ifndef USE_MINGW
+#include <selinux/selinux.h>
+#include <selinux/label.h>
+#include <selinux/android.h>
+#else
+struct selabel_handle;
+#endif
+
#include "make_ext4fs.h"
+#include "ext4_utils.h"
#ifndef USE_MINGW /* O_BINARY is windows-specific flag */
#define O_BINARY 0