Change include type policy
[lwext4.git] / include / ext4_types.h
index 23ea9008ac6e5d8476c0b8b8343da8e5fd88570c..d927cd8c74016ce5d4b4317dc8bd2ea28d8fb6a1 100644 (file)
@@ -46,9 +46,9 @@
 extern "C" {
 #endif
 
-#include "ext4_config.h"
-#include "ext4_blockdev.h"
-#include "misc/tree.h"
+#include <ext4_config.h>
+#include <ext4_blockdev.h>
+#include <misc/tree.h>
 
 #include <stddef.h>
 #include <stdint.h>
@@ -698,19 +698,20 @@ struct ext4_extent_header {
        ((struct ext4_extent_index *)(((char *)(__hdr__)) +                    \
                                    sizeof(struct ext4_extent_header)))
 #define EXT_HAS_FREE_INDEX(__path__)                                           \
-       ((__path__)->header->entries_count < (__path__)->header->max_entries_count)
+       (to_le16((__path__)->header->entries_count) <                                \
+                                   to_le16((__path__)->header->max_entries_count))
 #define EXT_LAST_EXTENT(__hdr__)                                               \
-       (EXT_FIRST_EXTENT((__hdr__)) + (__hdr__)->entries_count - 1)
+       (EXT_FIRST_EXTENT((__hdr__)) + to_le16((__hdr__)->entries_count) - 1)
 #define EXT_LAST_INDEX(__hdr__)                                                \
-       (EXT_FIRST_INDEX((__hdr__)) + (__hdr__)->entries_count - 1)
+       (EXT_FIRST_INDEX((__hdr__)) + to_le16((__hdr__)->entries_count) - 1)
 #define EXT_MAX_EXTENT(__hdr__)                                                \
-       (EXT_FIRST_EXTENT((__hdr__)) + (__hdr__)->max_entries_count - 1)
+       (EXT_FIRST_EXTENT((__hdr__)) + to_le16((__hdr__)->max_entries_count) - 1)
 #define EXT_MAX_INDEX(__hdr__)                                                 \
-       (EXT_FIRST_INDEX((__hdr__)) + (__hdr__)->max_entries_count - 1)
+       (EXT_FIRST_INDEX((__hdr__)) + to_le16((__hdr__)->max_entries_count) - 1)
 
 #define EXT4_EXTENT_TAIL_OFFSET(hdr)                                           \
        (sizeof(struct ext4_extent_header) +                                   \
-        (sizeof(struct ext4_extent) * (hdr)->max_entries_count))
+        (sizeof(struct ext4_extent) * to_le16((hdr)->max_entries_count)))
 
 /*
  * ext4_ext_next_allocated_block:
@@ -1005,12 +1006,12 @@ struct jbd_sb {
 #endif
 
 
-#ifdef USE_OTHER_MALLOC
+#if CONFIG_USE_USER_MALLOC
 
-#define ext4_malloc  pool_malloc
-#define ext4_calloc  pool_calloc
-#define ext4_realloc pool_realloc
-#define ext4_free    pool_free
+#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