diff options
author | Colin Cross <ccross@android.com> | 2013-01-23 18:42:51 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-01-23 18:42:51 -0800 |
commit | 30ea356ee447785c2098a815e0f7d3623692b068 (patch) | |
tree | 52c260f635da2f3bdaa57edeb0b091360ad7f82a | |
parent | ebe2ff59b5a14c5102b71000f24f06e9c6ee8fd7 (diff) | |
parent | 72acd48419ab568647552fb0d7d6ed376f75d4da (diff) | |
download | extras-30ea356ee447785c2098a815e0f7d3623692b068.tar.gz |
am 72acd484: Merge "ext4_utils: reduce exported apis"
# Via Colin Cross (1) and Gerrit Code Review (1)
* commit '72acd48419ab568647552fb0d7d6ed376f75d4da':
ext4_utils: reduce exported apis
-rw-r--r-- | ext4_utils/ext4_utils.h | 10 | ||||
-rw-r--r-- | ext4_utils/make_ext4fs.c | 8 | ||||
-rw-r--r-- | ext4_utils/make_ext4fs.h | 21 | ||||
-rw-r--r-- | ext4_utils/make_ext4fs_main.c | 10 |
4 files changed, 28 insertions, 21 deletions
diff --git a/ext4_utils/ext4_utils.h b/ext4_utils/ext4_utils.h index cad2eaea..520b3567 100644 --- a/ext4_utils/ext4_utils.h +++ b/ext4_utils/ext4_utils.h @@ -167,6 +167,16 @@ u64 get_file_size(int fd); 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 57179125..e69b473a 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 @@ void reset_ext4fs_info() { } } -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 @@ int make_ext4fs_sparse_fd(int fd, s64 len, 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 d75ea02a..3784a9ea 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 3f6d35bb..71fc3c18 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 |