aboutsummaryrefslogtreecommitdiff
path: root/util-linux
diff options
context:
space:
mode:
Diffstat (limited to 'util-linux')
-rw-r--r--util-linux/fsck_minix.c30
-rw-r--r--util-linux/minix.h4
-rw-r--r--util-linux/mkfs_minix.c10
3 files changed, 22 insertions, 22 deletions
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index b0d5c6a3f..2dbd437a3 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -29,7 +29,7 @@
29 * 28.02.93 - added support for different directory entry sizes.. 29 * 28.02.93 - added support for different directory entry sizes..
30 * 30 *
31 * Sat Mar 6 18:59:42 1993, faith@cs.unc.edu: Output namelen with 31 * Sat Mar 6 18:59:42 1993, faith@cs.unc.edu: Output namelen with
32 * super-block information 32 * superblock information
33 * 33 *
34 * Sat Oct 9 11:17:11 1993, faith@cs.unc.edu: make exit status conform 34 * Sat Oct 9 11:17:11 1993, faith@cs.unc.edu: make exit status conform
35 * to that required by fsutil 35 * to that required by fsutil
@@ -79,7 +79,7 @@
79 * -a for automatic repairs (not implemented) 79 * -a for automatic repairs (not implemented)
80 * -r for repairs (interactive) (not implemented) 80 * -r for repairs (interactive) (not implemented)
81 * -v for verbose (tells how many files) 81 * -v for verbose (tells how many files)
82 * -s for super-block info 82 * -s for superblock info
83 * -m for minix-like "mode not cleared" warnings 83 * -m for minix-like "mode not cleared" warnings
84 * -f force filesystem check even if filesystem marked as valid 84 * -f force filesystem check even if filesystem marked as valid
85 * 85 *
@@ -148,7 +148,7 @@ struct globals {
148 148
149 /* Bigger stuff */ 149 /* Bigger stuff */
150 struct termios sv_termios; 150 struct termios sv_termios;
151 char super_block_buffer[BLOCK_SIZE]; 151 char superblock_buffer[BLOCK_SIZE];
152 char add_zone_ind_blk[BLOCK_SIZE]; 152 char add_zone_ind_blk[BLOCK_SIZE];
153 char add_zone_dind_blk[BLOCK_SIZE]; 153 char add_zone_dind_blk[BLOCK_SIZE];
154 USE_FEATURE_MINIX2(char add_zone_tind_blk[BLOCK_SIZE];) 154 USE_FEATURE_MINIX2(char add_zone_tind_blk[BLOCK_SIZE];)
@@ -183,7 +183,7 @@ struct globals {
183#define name_depth (G.name_depth ) 183#define name_depth (G.name_depth )
184#define name_component (G.name_component ) 184#define name_component (G.name_component )
185#define sv_termios (G.sv_termios ) 185#define sv_termios (G.sv_termios )
186#define super_block_buffer (G.super_block_buffer ) 186#define superblock_buffer (G.superblock_buffer )
187#define add_zone_ind_blk (G.add_zone_ind_blk ) 187#define add_zone_ind_blk (G.add_zone_ind_blk )
188#define add_zone_dind_blk (G.add_zone_dind_blk ) 188#define add_zone_dind_blk (G.add_zone_dind_blk )
189#define add_zone_tind_blk (G.add_zone_tind_blk ) 189#define add_zone_tind_blk (G.add_zone_tind_blk )
@@ -223,7 +223,7 @@ enum {
223#define Inode1 (((struct minix1_inode *) inode_buffer)-1) 223#define Inode1 (((struct minix1_inode *) inode_buffer)-1)
224#define Inode2 (((struct minix2_inode *) inode_buffer)-1) 224#define Inode2 (((struct minix2_inode *) inode_buffer)-1)
225 225
226#define Super (*(struct minix_super_block *)(super_block_buffer)) 226#define Super (*(struct minix_superblock *)(superblock_buffer))
227 227
228#if ENABLE_FEATURE_MINIX2 228#if ENABLE_FEATURE_MINIX2
229# define ZONES ((unsigned)(version2 ? Super.s_zones : Super.s_nzones)) 229# define ZONES ((unsigned)(version2 ? Super.s_zones : Super.s_nzones))
@@ -560,7 +560,7 @@ static int map_block2(struct minix2_inode *inode, unsigned blknr)
560} 560}
561#endif 561#endif
562 562
563static void write_super_block(void) 563static void write_superblock(void)
564{ 564{
565 /* 565 /*
566 * Set the state of the filesystem based on whether or not there 566 * Set the state of the filesystem based on whether or not there
@@ -572,13 +572,13 @@ static void write_super_block(void)
572 Super.s_state &= ~MINIX_ERROR_FS; 572 Super.s_state &= ~MINIX_ERROR_FS;
573 573
574 xlseek(dev_fd, BLOCK_SIZE, SEEK_SET); 574 xlseek(dev_fd, BLOCK_SIZE, SEEK_SET);
575 if (BLOCK_SIZE != full_write(dev_fd, super_block_buffer, BLOCK_SIZE)) 575 if (BLOCK_SIZE != full_write(dev_fd, superblock_buffer, BLOCK_SIZE))
576 die("cannot write super-block"); 576 die("cannot write superblock");
577} 577}
578 578
579static void write_tables(void) 579static void write_tables(void)
580{ 580{
581 write_super_block(); 581 write_superblock();
582 582
583 if (IMAPS * BLOCK_SIZE != write(dev_fd, inode_map, IMAPS * BLOCK_SIZE)) 583 if (IMAPS * BLOCK_SIZE != write(dev_fd, inode_map, IMAPS * BLOCK_SIZE))
584 die("cannot write inode map"); 584 die("cannot write inode map");
@@ -614,8 +614,8 @@ static void get_dirsize(void)
614static void read_superblock(void) 614static void read_superblock(void)
615{ 615{
616 xlseek(dev_fd, BLOCK_SIZE, SEEK_SET); 616 xlseek(dev_fd, BLOCK_SIZE, SEEK_SET);
617 if (BLOCK_SIZE != full_read(dev_fd, super_block_buffer, BLOCK_SIZE)) 617 if (BLOCK_SIZE != full_read(dev_fd, superblock_buffer, BLOCK_SIZE))
618 die("cannot read super block"); 618 die("cannot read superblock");
619 /* already initialized to: 619 /* already initialized to:
620 namelen = 14; 620 namelen = 14;
621 dirsize = 16; 621 dirsize = 16;
@@ -634,13 +634,13 @@ static void read_superblock(void)
634 version2 = 1; 634 version2 = 1;
635#endif 635#endif
636 } else 636 } else
637 die("bad magic number in super-block"); 637 die("bad magic number in superblock");
638 if (ZONESIZE != 0 || BLOCK_SIZE != 1024) 638 if (ZONESIZE != 0 || BLOCK_SIZE != 1024)
639 die("only 1k blocks/zones supported"); 639 die("only 1k blocks/zones supported");
640 if (IMAPS * BLOCK_SIZE * 8 < INODES + 1) 640 if (IMAPS * BLOCK_SIZE * 8 < INODES + 1)
641 die("bad s_imap_blocks field in super-block"); 641 die("bad s_imap_blocks field in superblock");
642 if (ZMAPS * BLOCK_SIZE * 8 < ZONES - FIRSTZONE + 1) 642 if (ZMAPS * BLOCK_SIZE * 8 < ZONES - FIRSTZONE + 1)
643 die("bad s_zmap_blocks field in super-block"); 643 die("bad s_zmap_blocks field in superblock");
644} 644}
645 645
646static void read_tables(void) 646static void read_tables(void)
@@ -1296,7 +1296,7 @@ int fsck_minix_main(int argc UNUSED_PARAM, char **argv)
1296 printf("FILE SYSTEM HAS BEEN CHANGED\n"); 1296 printf("FILE SYSTEM HAS BEEN CHANGED\n");
1297 sync(); 1297 sync();
1298 } else if (OPT_repair) 1298 } else if (OPT_repair)
1299 write_super_block(); 1299 write_superblock();
1300 1300
1301 if (OPT_manual) 1301 if (OPT_manual)
1302 tcsetattr(0, TCSANOW, &sv_termios); 1302 tcsetattr(0, TCSANOW, &sv_termios);
diff --git a/util-linux/minix.h b/util-linux/minix.h
index e630fe033..3e2b989e3 100644
--- a/util-linux/minix.h
+++ b/util-linux/minix.h
@@ -31,9 +31,9 @@ struct minix2_inode {
31}; 31};
32 32
33/* 33/*
34 * minix super-block data on disk 34 * minix superblock data on disk
35 */ 35 */
36struct minix_super_block { 36struct minix_superblock {
37 uint16_t s_ninodes; 37 uint16_t s_ninodes;
38 uint16_t s_nzones; 38 uint16_t s_nzones;
39 uint16_t s_imap_blocks; 39 uint16_t s_imap_blocks;
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c
index ceeb72a2b..8c3991a99 100644
--- a/util-linux/mkfs_minix.c
+++ b/util-linux/mkfs_minix.c
@@ -109,7 +109,7 @@ struct globals {
109 unsigned currently_testing; 109 unsigned currently_testing;
110 110
111 char root_block[BLOCK_SIZE]; 111 char root_block[BLOCK_SIZE];
112 char super_block_buffer[BLOCK_SIZE]; 112 char superblock_buffer[BLOCK_SIZE];
113 char boot_block_buffer[512]; 113 char boot_block_buffer[512];
114 unsigned short good_blocks_table[MAX_GOOD_BLOCKS]; 114 unsigned short good_blocks_table[MAX_GOOD_BLOCKS];
115 /* check_blocks(): buffer[] was the biggest static in entire bbox */ 115 /* check_blocks(): buffer[] was the biggest static in entire bbox */
@@ -133,7 +133,7 @@ static ALWAYS_INLINE unsigned div_roundup(unsigned size, unsigned n)
133#define INODE_BUF1 (((struct minix1_inode*)G.inode_buffer) - 1) 133#define INODE_BUF1 (((struct minix1_inode*)G.inode_buffer) - 1)
134#define INODE_BUF2 (((struct minix2_inode*)G.inode_buffer) - 1) 134#define INODE_BUF2 (((struct minix2_inode*)G.inode_buffer) - 1)
135 135
136#define SB (*(struct minix_super_block*)G.super_block_buffer) 136#define SB (*(struct minix_superblock*)G.superblock_buffer)
137 137
138#define SB_INODES (SB.s_ninodes) 138#define SB_INODES (SB.s_ninodes)
139#define SB_IMAPS (SB.s_imap_blocks) 139#define SB_IMAPS (SB.s_imap_blocks)
@@ -235,7 +235,7 @@ static int get_size(const char *file)
235 235
236static void write_tables(void) 236static void write_tables(void)
237{ 237{
238 /* Mark the super block valid. */ 238 /* Mark the superblock valid. */
239 SB.s_state |= MINIX_VALID_FS; 239 SB.s_state |= MINIX_VALID_FS;
240 SB.s_state &= ~MINIX_ERROR_FS; 240 SB.s_state &= ~MINIX_ERROR_FS;
241 241
@@ -249,7 +249,7 @@ static void write_tables(void)
249 xlseek(dev_fd, BLOCK_SIZE, SEEK_SET); 249 xlseek(dev_fd, BLOCK_SIZE, SEEK_SET);
250 250
251 msg_eol = "cannot write superblock"; 251 msg_eol = "cannot write superblock";
252 xwrite(dev_fd, G.super_block_buffer, BLOCK_SIZE); 252 xwrite(dev_fd, G.superblock_buffer, BLOCK_SIZE);
253 253
254 msg_eol = "cannot write inode map"; 254 msg_eol = "cannot write inode map";
255 xwrite(dev_fd, G.inode_map, SB_IMAPS * BLOCK_SIZE); 255 xwrite(dev_fd, G.inode_map, SB_IMAPS * BLOCK_SIZE);
@@ -556,7 +556,7 @@ static void setup_tables(void)
556 unsigned sb_zmaps; 556 unsigned sb_zmaps;
557 unsigned i; 557 unsigned i;
558 558
559 /* memset(G.super_block_buffer, 0, BLOCK_SIZE); */ 559 /* memset(G.superblock_buffer, 0, BLOCK_SIZE); */
560 /* memset(G.boot_block_buffer, 0, 512); */ 560 /* memset(G.boot_block_buffer, 0, 512); */
561 SB_MAGIC = G.magic; 561 SB_MAGIC = G.magic;
562 SB_ZONE_SIZE = 0; 562 SB_ZONE_SIZE = 0;