| @@ -698,19 +698,20 @@ struct ext4_extent_header { · 697 unmodified lines |
| 698 | ((struct ext4_extent_index *)(((char *)(__hdr__)) + \ | 698 | ((struct ext4_extent_index *)(((char *)(__hdr__)) + \ |
| 699 | sizeof(struct ext4_extent_header))) | 699 | sizeof(struct ext4_extent_header))) |
| 700 | #define EXT_HAS_FREE_INDEX(__path__) \ | 700 | #define EXT_HAS_FREE_INDEX(__path__) \ |
| 701 | ((__path__)->header->entries_count < (__path__)->header->max_entries_count) | 701 | (to_le16((__path__)->header->entries_count) < \ |
| | 702 | to_le16((__path__)->header->max_entries_count)) |
| 702 | #define EXT_LAST_EXTENT(__hdr__) \ | 703 | #define EXT_LAST_EXTENT(__hdr__) \ |
| 703 | (EXT_FIRST_EXTENT((__hdr__)) + (__hdr__)->entries_count - 1) | 704 | (EXT_FIRST_EXTENT((__hdr__)) + to_le16((__hdr__)->entries_count) - 1) |
| 704 | #define EXT_LAST_INDEX(__hdr__) \ | 705 | #define EXT_LAST_INDEX(__hdr__) \ |
| 705 | (EXT_FIRST_INDEX((__hdr__)) + (__hdr__)->entries_count - 1) | 706 | (EXT_FIRST_INDEX((__hdr__)) + to_le16((__hdr__)->entries_count) - 1) |
| 706 | #define EXT_MAX_EXTENT(__hdr__) \ | 707 | #define EXT_MAX_EXTENT(__hdr__) \ |
| 707 | (EXT_FIRST_EXTENT((__hdr__)) + (__hdr__)->max_entries_count - 1) | 708 | (EXT_FIRST_EXTENT((__hdr__)) + to_le16((__hdr__)->max_entries_count) - 1) |
| 708 | #define EXT_MAX_INDEX(__hdr__) \ | 709 | #define EXT_MAX_INDEX(__hdr__) \ |
| 709 | (EXT_FIRST_INDEX((__hdr__)) + (__hdr__)->max_entries_count - 1) | 710 | (EXT_FIRST_INDEX((__hdr__)) + to_le16((__hdr__)->max_entries_count) - 1) |
| 710 | | 711 | |
| 711 | #define EXT4_EXTENT_TAIL_OFFSET(hdr) \ | 712 | #define EXT4_EXTENT_TAIL_OFFSET(hdr) \ |
| 712 | (sizeof(struct ext4_extent_header) + \ | 713 | (sizeof(struct ext4_extent_header) + \ |
| 713 | (sizeof(struct ext4_extent) * (hdr)->max_entries_count)) | 714 | (sizeof(struct ext4_extent) * to_le16((hdr)->max_entries_count))) |
| 714 | | 715 | |
| 715 | /* | 716 | /* |
| 716 | * ext4_ext_next_allocated_block: | 717 | * ext4_ext_next_allocated_block: |