OSDN Git Service

Change the API for make_ext4fs() to better match the user's needs
authorKen Sumrall <ksumrall@android.com>
Thu, 20 Jan 2011 01:15:42 +0000 (17:15 -0800)
committerKen Sumrall <ksumrall@android.com>
Thu, 20 Jan 2011 01:15:42 +0000 (17:15 -0800)
The current make_ext4fs() is renamed make_ext4fs_internal(), and a new
make_ext4fs() has a simplified interface that supports the needs of
recovery and updater packages that call it.

Change-Id: I9e897f1f442c7f5060f8623ea74c3cf6a9c023e4

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

index a366a37..5742261 100644 (file)
@@ -242,9 +242,16 @@ void reset_ext4fs_info() {
     free_data_blocks();
 }
 
-int make_ext4fs(const char *filename, const char *directory,
-                char *mountpoint, int android, int gzip, int sparse,
-                int crc)
+int make_ext4fs(const char *filename, s64 len)
+{
+    reset_ext4fs_info();
+    info.len = len;
+    return make_ext4fs_internal(filename, NULL, NULL, 0, 0, 0, 0);
+}
+
+int make_ext4fs_internal(const char *filename, const char *directory,
+                         char *mountpoint, int android, int gzip, int sparse,
+                         int crc)
 {
         u32 root_inode_num;
         u16 root_mode;
index 78fcb07..1e82fa6 100644 (file)
@@ -21,8 +21,9 @@
 #include "ext4.h"
 
 void reset_ext4fs_info();
-int make_ext4fs(const char *filename, const char *directory,
-                char *mountpoint, int android, int gzip, int sparse,
-                int crc);
+int make_ext4fs(const char *filename, s64 len);
+int make_ext4fs_internal(const char *filename, const char *directory,
+                         char *mountpoint, int android, int gzip, int sparse,
+                         int crc);
 
 #endif
index 2b59082..bd7442e 100644 (file)
@@ -119,6 +119,6 @@ int main(int argc, char **argv)
                 exit(EXIT_FAILURE);
         }
 
-        return make_ext4fs(filename, directory, mountpoint, android, gzip,
+        return make_ext4fs_internal(filename, directory, mountpoint, android, gzip,
                        sparse, crc);
 }