1 // Copyright 2014 The Android Open Source Project 2 // 3 // This software is licensed under the terms of the GNU General Public 4 // License version 2, as published by the Free Software Foundation, and 5 // may be copied, distributed, and modified under those terms. 6 // 7 // This program is distributed in the hope that it will be useful, 8 // but WITHOUT ANY WARRANTY; without even the implied warranty of 9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 // GNU General Public License for more details. 11 12 #ifndef ANDROID_FILESYSTEMS_EXT4_UTILS_H 13 #define ANDROID_FILESYSTEMS_EXT4_UTILS_H 14 15 #include "android/utils/compiler.h" 16 17 #include <stdbool.h> 18 #include <inttypes.h> 19 20 ANDROID_BEGIN_HEADER 21 22 // Create a new empty EXT4 partition image file at |filePath| 23 // of |size| bytes. |mountPoint| is the name of the corresponding 24 // mount point, e.g. 'cache' for the cache partition. 25 // Returns 0 on success, or -errno on failure. 26 int android_createEmptyExt4Image(const char *filePath, 27 uint64_t size, 28 const char *mountpoint); 29 30 // Returns true iff the file at |filePath| is an actual EXT4 partition image. 31 bool android_pathIsExt4PartitionImage(const char* filePath); 32 33 34 ANDROID_END_HEADER 35 36 #endif // ANDROID_FILESYSTEMS_EXT4_UTILS_H 37