diff options
Diffstat (limited to 'util-linux/mkfs_minix.c')
-rw-r--r-- | util-linux/mkfs_minix.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c index 88647e9d8..69dfcd123 100644 --- a/util-linux/mkfs_minix.c +++ b/util-linux/mkfs_minix.c | |||
@@ -142,7 +142,10 @@ struct globals { | |||
142 | unsigned currently_testing; | 142 | unsigned currently_testing; |
143 | 143 | ||
144 | char root_block[BLOCK_SIZE]; | 144 | char root_block[BLOCK_SIZE]; |
145 | char superblock_buffer[BLOCK_SIZE]; | 145 | union { |
146 | char superblock_buffer[BLOCK_SIZE]; | ||
147 | struct minix_superblock SB; | ||
148 | } u; | ||
146 | char boot_block_buffer[512]; | 149 | char boot_block_buffer[512]; |
147 | unsigned short good_blocks_table[MAX_GOOD_BLOCKS]; | 150 | unsigned short good_blocks_table[MAX_GOOD_BLOCKS]; |
148 | /* check_blocks(): buffer[] was the biggest static in entire bbox */ | 151 | /* check_blocks(): buffer[] was the biggest static in entire bbox */ |
@@ -166,7 +169,7 @@ static ALWAYS_INLINE unsigned div_roundup(unsigned size, unsigned n) | |||
166 | #define INODE_BUF1 (((struct minix1_inode*)G.inode_buffer) - 1) | 169 | #define INODE_BUF1 (((struct minix1_inode*)G.inode_buffer) - 1) |
167 | #define INODE_BUF2 (((struct minix2_inode*)G.inode_buffer) - 1) | 170 | #define INODE_BUF2 (((struct minix2_inode*)G.inode_buffer) - 1) |
168 | 171 | ||
169 | #define SB (*(struct minix_superblock*)G.superblock_buffer) | 172 | #define SB (G.u.SB) |
170 | 173 | ||
171 | #define SB_INODES (SB.s_ninodes) | 174 | #define SB_INODES (SB.s_ninodes) |
172 | #define SB_IMAPS (SB.s_imap_blocks) | 175 | #define SB_IMAPS (SB.s_imap_blocks) |
@@ -234,7 +237,7 @@ static void write_tables(void) | |||
234 | xlseek(dev_fd, BLOCK_SIZE, SEEK_SET); | 237 | xlseek(dev_fd, BLOCK_SIZE, SEEK_SET); |
235 | 238 | ||
236 | msg_eol = "can't write superblock"; | 239 | msg_eol = "can't write superblock"; |
237 | xwrite(dev_fd, G.superblock_buffer, BLOCK_SIZE); | 240 | xwrite(dev_fd, G.u.superblock_buffer, BLOCK_SIZE); |
238 | 241 | ||
239 | msg_eol = "can't write inode map"; | 242 | msg_eol = "can't write inode map"; |
240 | xwrite(dev_fd, G.inode_map, SB_IMAPS * BLOCK_SIZE); | 243 | xwrite(dev_fd, G.inode_map, SB_IMAPS * BLOCK_SIZE); |
@@ -541,7 +544,7 @@ static void setup_tables(void) | |||
541 | unsigned sb_zmaps; | 544 | unsigned sb_zmaps; |
542 | unsigned i; | 545 | unsigned i; |
543 | 546 | ||
544 | /* memset(G.superblock_buffer, 0, BLOCK_SIZE); */ | 547 | /* memset(G.u.superblock_buffer, 0, BLOCK_SIZE); */ |
545 | /* memset(G.boot_block_buffer, 0, 512); */ | 548 | /* memset(G.boot_block_buffer, 0, 512); */ |
546 | SB_MAGIC = G.magic; | 549 | SB_MAGIC = G.magic; |
547 | SB_ZONE_SIZE = 0; | 550 | SB_ZONE_SIZE = 0; |