From de0b71af1e9d141c3234aa10376d5bcf79e47c55 Mon Sep 17 00:00:00 2001 From: Liu Aleaxander Date: Sat, 8 Aug 2009 17:03:56 +0800 Subject: Core:EXTLINUX: fix the bug of open_file_t struct in extlinux The size of open_file_t structure in extlinux is twice than in the others derivatiives. So we should cut the MAX_OPEN to half. Signed-off-by: Liu Aleaxander --- core/ext2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/ext2.c b/core/ext2.c index 153f368e..965f1b43 100644 --- a/core/ext2.c +++ b/core/ext2.c @@ -8,7 +8,8 @@ #define FILENAME_MAX_LG2 8 #define FILENAME_MAX (1 << FILENAME_MAX_LG2) -#define MAX_OPEN_LG2 6 +/* The size of open_file_t in extlinux is double of in others */ +#define MAX_OPEN_LG2 (6 - 1) #define MAX_OPEN (1 << MAX_OPEN_LG2) #define MAX_SYMLINKS 64 #define SYMLINK_SECTORS 2 @@ -22,6 +23,7 @@ struct open_file_t { sector_t file_in_sec; /* Sector where inode lives */ uint16_t file_in_off; uint16_t file_mode; + uint32_t pad[3]; /* pad to 2^5 == 0x20 bytes */ }; static char SymlinkBuf[SYMLINK_SECTORS * SECTOR_SIZE + 64]; -- cgit v1.2.1