diff options
| author | branzhu <branzhu@outlook.com> | 2017-03-24 00:51:51 -0400 |
|---|---|---|
| committer | branzhu <branzhu@outlook.com> | 2017-03-24 00:51:51 -0400 |
| commit | 02eb05014ff09bbadca174a2924ff2bdbc69b97e (patch) | |
| tree | 606e39d4dbe56dbf785c4008a02e8386b8c85896 /include | |
| parent | 9c59c0b576a924d6acda7c4b745b668f5e958f5c (diff) | |
Fix issues with big-endian system
Diffstat (limited to 'include')
| -rw-r--r-- | include/ext4_types.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/include/ext4_types.h b/include/ext4_types.h index 2d9e49c..80e9a0f 100644 --- a/include/ext4_types.h +++ b/include/ext4_types.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: |
