OSDN Git Service

ext4_utils: reduce exported apis
authorColin Cross <ccross@android.com>
Wed, 23 Jan 2013 23:38:57 +0000 (15:38 -0800)
committerColin Cross <ccross@android.com>
Thu, 24 Jan 2013 01:00:13 +0000 (17:00 -0800)
Remove unnecessary functions from make_ext4fs.h so they are not
exposed to users of libext4_utils.

Requires fixing up some internal places that depended on the
definitions in the external make_ext4fs.h header.

Change-Id: Ied24e0efb648d4fd2ccdd1a5a1b685e9bde9cfd7

ext4_utils/ext4_utils.h
ext4_utils/make_ext4fs.c
ext4_utils/make_ext4fs.h
ext4_utils/make_ext4fs_main.c

index cad2eae..520b356 100644 (file)
@@ -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
index 5717912..e69b473 100644 (file)
 
 #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;
index d75ea02..3784a9e 100644 (file)
 #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
 }
index 3f6d35b..71fc3c1 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <fcntl.h>
 #include <libgen.h>
+#include <stdio.h>
 #include <unistd.h>
 
 #if defined(__linux__)
 #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