#define EXT4_INODE_ROOT_INDEX 2
-struct ext4_inode_ref {
- struct ext4_block block;
- struct ext4_inode *inode;
- struct ext4_fs *fs;
- uint32_t index;
- bool dirty;
-};
#define EXT4_DIRECTORY_FILENAME_LEN 255
uint8_t name_len; /* Lower 8 bits of name length */
union ext4_dir_en_internal in;
-
- uint8_t name[EXT4_DIRECTORY_FILENAME_LEN]; /* Entry name */
-};
-
-struct ext4_dir_iter {
- struct ext4_inode_ref *inode_ref;
- struct ext4_block curr_blk;
- uint64_t curr_off;
- struct ext4_dir_en *curr;
-};
-
-struct ext4_dir_search_result {
- struct ext4_block block;
- struct ext4_dir_en *dentry;
+ uint8_t name[]; /* Entry name */
};
/* Structures for indexed directory */
struct ext4_dir_idx_entry entries[];
};
-struct ext4_dir_idx_block {
- struct ext4_block b;
- struct ext4_dir_idx_entry *entries;
- struct ext4_dir_idx_entry *position;
-};
-
/*
* This goes at the end of each htree block.
*/
#define EXT4_GOOD_OLD_INODE_SIZE 128
-#define EXT4_XATTR_PAD_BITS 2
-#define EXT4_XATTR_PAD (1<<EXT4_XATTR_PAD_BITS)
-#define EXT4_XATTR_ROUND (EXT4_XATTR_PAD-1)
-#define EXT4_XATTR_LEN(name_len) \
- (((name_len) + EXT4_XATTR_ROUND + \
- sizeof(struct ext4_xattr_entry)) & ~EXT4_XATTR_ROUND)
-#define EXT4_XATTR_NEXT(entry) \
- ((struct ext4_xattr_entry *)( \
- (char *)(entry) + EXT4_XATTR_LEN((entry)->e_name_len)))
-#define EXT4_XATTR_SIZE(size) \
- (((size) + EXT4_XATTR_ROUND) & ~EXT4_XATTR_ROUND)
-#define EXT4_XATTR_NAME(entry) \
- ((char *)((entry) + 1))
-
-#define EXT4_XATTR_IHDR(raw_inode) \
- ((struct ext4_xattr_ibody_header *) \
- ((char *)raw_inode + \
- EXT4_GOOD_OLD_INODE_SIZE + \
- (raw_inode)->extra_isize))
-#define EXT4_XATTR_IFIRST(hdr) \
- ((struct ext4_xattr_entry *)((hdr)+1))
-
-#define EXT4_XATTR_BHDR(block) \
- ((struct ext4_xattr_header *)((block)->data))
-#define EXT4_XATTR_ENTRY(ptr) \
- ((struct ext4_xattr_entry *)(ptr))
-#define EXT4_XATTR_BFIRST(block) \
- EXT4_XATTR_ENTRY(EXT4_XATTR_BHDR(block)+1)
-#define EXT4_XATTR_IS_LAST_ENTRY(entry) \
- (*(uint32_t *)(entry) == 0)
-
-#define EXT4_ZERO_XATTR_VALUE ((void *)-1)
-
/*****************************************************************************/
/*
}
#endif
+
+#if CONFIG_USE_USER_MALLOC
+
+#define ext4_malloc ext4_user_malloc
+#define ext4_calloc ext4_user_calloc
+#define ext4_realloc ext4_user_realloc
+#define ext4_free ext4_user_free
+
+#else
+
+#define ext4_malloc malloc
+#define ext4_calloc calloc
+#define ext4_realloc realloc
+#define ext4_free free
+
+#endif
+
+
#endif /* EXT4_TYPES_H_ */
/**