Add LDFLAGS when building libsparse.a
[project/make_ext4fs.git] / contents.c
index bfdb657528712f52e14c85ee1074a8c5d64010fa..9b65dbe7f557e104a8b67248b3f2bee40983a6be 100644 (file)
 #include <string.h>
 #include <stdio.h>
 
-#ifdef HAVE_ANDROID_OS
-#include <linux/capability.h>
-#else
 #include <private/android_filesystem_capability.h>
-#endif
 
 #define XATTR_SELINUX_SUFFIX "selinux"
 #define XATTR_CAPS_SUFFIX "capability"
 
 #include "ext4_utils.h"
-#include "make_ext4fs.h"
 #include "allocate.h"
 #include "contents.h"
 #include "extent.h"
 #include "indirect.h"
 
-#ifdef USE_MINGW
-#define S_IFLNK 0  /* used by make_link, not needed under mingw */
-#endif
-
 static struct block_allocation* saved_allocation_head = NULL;
 
 struct block_allocation* get_saved_allocation_chain() {
@@ -112,7 +103,7 @@ u32 make_directory(u32 dir_inode_num, u32 entries, struct dentry *dentries,
        len = blocks * info.block_size;
 
        if (dir_inode_num) {
-               inode_num = allocate_inode(info);
+               inode_num = allocate_inode();
        } else {
                dir_inode_num = EXT4_ROOT_INO;
                inode_num = EXT4_ROOT_INO;
@@ -180,7 +171,7 @@ u32 make_file(const char *filename, u64 len)
        struct ext4_inode *inode;
        u32 inode_num;
 
-       inode_num = allocate_inode(info);
+       inode_num = allocate_inode();
        if (inode_num == EXT4_ALLOCATE_FAILED) {
                error("failed to allocate inode\n");
                return EXT4_ALLOCATE_FAILED;
@@ -215,7 +206,7 @@ u32 make_link(const char *link)
        u32 inode_num;
        u32 len = strlen(link);
 
-       inode_num = allocate_inode(info);
+       inode_num = allocate_inode();
        if (inode_num == EXT4_ALLOCATE_FAILED) {
                error("failed to allocate inode\n");
                return EXT4_ALLOCATE_FAILED;
@@ -256,7 +247,7 @@ u32 make_special(const char *path)
                return EXT4_ALLOCATE_FAILED;
        }
 
-       inode_num = allocate_inode(info);
+       inode_num = allocate_inode();
        if (inode_num == EXT4_ALLOCATE_FAILED) {
                error("failed to allocate inode\n");
                return EXT4_ALLOCATE_FAILED;
@@ -497,15 +488,6 @@ static int xattr_add(u32 inode_num, int name_index, const char *name,
        return result;
 }
 
-int inode_set_selinux(u32 inode_num, const char *secon)
-{
-       if (!secon)
-               return 0;
-
-       return xattr_add(inode_num, EXT4_XATTR_INDEX_SECURITY,
-               XATTR_SELINUX_SUFFIX, secon, strlen(secon) + 1);
-}
-
 int inode_set_capabilities(u32 inode_num, uint64_t capabilities) {
        if (capabilities == 0)
                return 0;