History

Fix issues with big-endian system

branzhu committed 9 years ago

Commit 02eb0501 parent 9c59c0b3 files · +9 −8Browse files

Showing the changes to include (1 of 3 files). Show all

Unified · Split

include/ext4_types.h+7−6
@@ -698,19 +698,20 @@ struct ext4_extent_header { · 697 unmodified lines
698698 ((struct ext4_extent_index *)(((char *)(__hdr__)) + \
699699 sizeof(struct ext4_extent_header)))
700700 #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))
702703 #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)
704705 #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)
706707 #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)
708709 #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)
710711
711712 #define EXT4_EXTENT_TAIL_OFFSET(hdr) \
712713 (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)))
714715
715716 /*
716717 * ext4_ext_next_allocated_block:

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t