summaryrefslogtreecommitdiff
path: root/util-linux/fsck_minix.c
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-10-24 05:00:29 +0000
committerEric Andersen <andersen@codepoet.org>2001-10-24 05:00:29 +0000
commitbdfd0d78bc44e73d693510e70087857785b3b521 (patch)
tree153a573095afac8d8d0ea857759ecabd77fb28b7 /util-linux/fsck_minix.c
parent9260fc5552a3ee52eb95823aa6689d52a1ffd33c (diff)
downloadbusybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.tar.gz
busybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.tar.bz2
busybox-w32-bdfd0d78bc44e73d693510e70087857785b3b521.zip
Major rework of the directory structure and the entire build system.
-Erik
Diffstat (limited to 'util-linux/fsck_minix.c')
-rw-r--r--util-linux/fsck_minix.c42
1 files changed, 21 insertions, 21 deletions
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index 952968d85..dbe4f74b3 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -191,7 +191,7 @@ static const int ROOT_INO = 1;
191 191
192#define UPPER(size,n) ((size+((n)-1))/(n)) 192#define UPPER(size,n) ((size+((n)-1))/(n))
193#define INODE_SIZE (sizeof(struct minix_inode)) 193#define INODE_SIZE (sizeof(struct minix_inode))
194#ifdef BB_FEATURE_MINIX2 194#ifdef CONFIG_FEATURE_MINIX2
195#define INODE_SIZE2 (sizeof(struct minix2_inode)) 195#define INODE_SIZE2 (sizeof(struct minix2_inode))
196#define INODE_BLOCKS UPPER(INODES, (version2 ? MINIX2_INODES_PER_BLOCK \ 196#define INODE_BLOCKS UPPER(INODES, (version2 ? MINIX2_INODES_PER_BLOCK \
197 : MINIX_INODES_PER_BLOCK)) 197 : MINIX_INODES_PER_BLOCK))
@@ -232,7 +232,7 @@ static char super_block_buffer[BLOCK_SIZE];
232 232
233#define Super (*(struct minix_super_block *)super_block_buffer) 233#define Super (*(struct minix_super_block *)super_block_buffer)
234#define INODES ((unsigned long)Super.s_ninodes) 234#define INODES ((unsigned long)Super.s_ninodes)
235#ifdef BB_FEATURE_MINIX2 235#ifdef CONFIG_FEATURE_MINIX2
236#define ZONES ((unsigned long)(version2 ? Super.s_zones : Super.s_nzones)) 236#define ZONES ((unsigned long)(version2 ? Super.s_zones : Super.s_nzones))
237#else 237#else
238#define ZONES ((unsigned long)(Super.s_nzones)) 238#define ZONES ((unsigned long)(Super.s_nzones))
@@ -252,7 +252,7 @@ static unsigned char *inode_count = NULL;
252static unsigned char *zone_count = NULL; 252static unsigned char *zone_count = NULL;
253 253
254static void recursive_check(unsigned int ino); 254static void recursive_check(unsigned int ino);
255#ifdef BB_FEATURE_MINIX2 255#ifdef CONFIG_FEATURE_MINIX2
256static void recursive_check2(unsigned int ino); 256static void recursive_check2(unsigned int ino);
257#endif 257#endif
258 258
@@ -408,7 +408,7 @@ static int check_zone_nr(unsigned short *nr, int *corrected)
408 return 0; 408 return 0;
409} 409}
410 410
411#ifdef BB_FEATURE_MINIX2 411#ifdef CONFIG_FEATURE_MINIX2
412static int check_zone_nr2(unsigned int *nr, int *corrected) 412static int check_zone_nr2(unsigned int *nr, int *corrected)
413{ 413{
414 if (!*nr) 414 if (!*nr)
@@ -515,7 +515,7 @@ static int map_block(struct minix_inode *inode, unsigned int blknr)
515 return result; 515 return result;
516} 516}
517 517
518#ifdef BB_FEATURE_MINIX2 518#ifdef CONFIG_FEATURE_MINIX2
519static int map_block2(struct minix2_inode *inode, unsigned int blknr) 519static int map_block2(struct minix2_inode *inode, unsigned int blknr)
520{ 520{
521 unsigned int ind[BLOCK_SIZE >> 2]; 521 unsigned int ind[BLOCK_SIZE >> 2];
@@ -613,7 +613,7 @@ static void get_dirsize(void)
613 char blk[BLOCK_SIZE]; 613 char blk[BLOCK_SIZE];
614 int size; 614 int size;
615 615
616#ifdef BB_FEATURE_MINIX2 616#ifdef CONFIG_FEATURE_MINIX2
617 if (version2) 617 if (version2)
618 block = Inode2[ROOT_INO].i_zone[0]; 618 block = Inode2[ROOT_INO].i_zone[0];
619 else 619 else
@@ -644,7 +644,7 @@ static void read_superblock(void)
644 namelen = 30; 644 namelen = 30;
645 dirsize = 32; 645 dirsize = 32;
646 version2 = 0; 646 version2 = 0;
647#ifdef BB_FEATURE_MINIX2 647#ifdef CONFIG_FEATURE_MINIX2
648 } else if (MAGIC == MINIX2_SUPER_MAGIC) { 648 } else if (MAGIC == MINIX2_SUPER_MAGIC) {
649 namelen = 14; 649 namelen = 14;
650 dirsize = 16; 650 dirsize = 16;
@@ -742,7 +742,7 @@ static struct minix_inode *get_inode(unsigned int nr)
742 return inode; 742 return inode;
743} 743}
744 744
745#ifdef BB_FEATURE_MINIX2 745#ifdef CONFIG_FEATURE_MINIX2
746static struct minix2_inode *get_inode2(unsigned int nr) 746static struct minix2_inode *get_inode2(unsigned int nr)
747{ 747{
748 struct minix2_inode *inode; 748 struct minix2_inode *inode;
@@ -798,7 +798,7 @@ static void check_root(void)
798 die("root inode isn't a directory"); 798 die("root inode isn't a directory");
799} 799}
800 800
801#ifdef BB_FEATURE_MINIX2 801#ifdef CONFIG_FEATURE_MINIX2
802static void check_root2(void) 802static void check_root2(void)
803{ 803{
804 struct minix2_inode *inode = Inode2 + ROOT_INO; 804 struct minix2_inode *inode = Inode2 + ROOT_INO;
@@ -841,7 +841,7 @@ static int add_zone(unsigned short *znr, int *corrected)
841 return block; 841 return block;
842} 842}
843 843
844#ifdef BB_FEATURE_MINIX2 844#ifdef CONFIG_FEATURE_MINIX2
845static int add_zone2(unsigned int *znr, int *corrected) 845static int add_zone2(unsigned int *znr, int *corrected)
846{ 846{
847 int result; 847 int result;
@@ -892,7 +892,7 @@ static void add_zone_ind(unsigned short *znr, int *corrected)
892 write_block(block, blk); 892 write_block(block, blk);
893} 893}
894 894
895#ifdef BB_FEATURE_MINIX2 895#ifdef CONFIG_FEATURE_MINIX2
896static void add_zone_ind2(unsigned int *znr, int *corrected) 896static void add_zone_ind2(unsigned int *znr, int *corrected)
897{ 897{
898 static char blk[BLOCK_SIZE]; 898 static char blk[BLOCK_SIZE];
@@ -926,7 +926,7 @@ static void add_zone_dind(unsigned short *znr, int *corrected)
926 write_block(block, blk); 926 write_block(block, blk);
927} 927}
928 928
929#ifdef BB_FEATURE_MINIX2 929#ifdef CONFIG_FEATURE_MINIX2
930static void add_zone_dind2(unsigned int *znr, int *corrected) 930static void add_zone_dind2(unsigned int *znr, int *corrected)
931{ 931{
932 static char blk[BLOCK_SIZE]; 932 static char blk[BLOCK_SIZE];
@@ -977,7 +977,7 @@ static void check_zones(unsigned int i)
977 add_zone_dind(8 + inode->i_zone, &changed); 977 add_zone_dind(8 + inode->i_zone, &changed);
978} 978}
979 979
980#ifdef BB_FEATURE_MINIX2 980#ifdef CONFIG_FEATURE_MINIX2
981static void check_zones2(unsigned int i) 981static void check_zones2(unsigned int i)
982{ 982{
983 struct minix2_inode *inode; 983 struct minix2_inode *inode;
@@ -1062,7 +1062,7 @@ static void check_file(struct minix_inode *dir, unsigned int offset)
1062 return; 1062 return;
1063} 1063}
1064 1064
1065#ifdef BB_FEATURE_MINIX2 1065#ifdef CONFIG_FEATURE_MINIX2
1066static void check_file2(struct minix2_inode *dir, unsigned int offset) 1066static void check_file2(struct minix2_inode *dir, unsigned int offset)
1067{ 1067{
1068 static char blk[BLOCK_SIZE]; 1068 static char blk[BLOCK_SIZE];
@@ -1143,7 +1143,7 @@ static void recursive_check(unsigned int ino)
1143 check_file(dir, offset); 1143 check_file(dir, offset);
1144} 1144}
1145 1145
1146#ifdef BB_FEATURE_MINIX2 1146#ifdef CONFIG_FEATURE_MINIX2
1147static void recursive_check2(unsigned int ino) 1147static void recursive_check2(unsigned int ino)
1148{ 1148{
1149 struct minix2_inode *dir; 1149 struct minix2_inode *dir;
@@ -1221,7 +1221,7 @@ static void check_counts(void)
1221 } 1221 }
1222} 1222}
1223 1223
1224#ifdef BB_FEATURE_MINIX2 1224#ifdef CONFIG_FEATURE_MINIX2
1225static void check_counts2(void) 1225static void check_counts2(void)
1226{ 1226{
1227 int i; 1227 int i;
@@ -1283,7 +1283,7 @@ static void check(void)
1283 check_counts(); 1283 check_counts();
1284} 1284}
1285 1285
1286#ifdef BB_FEATURE_MINIX2 1286#ifdef CONFIG_FEATURE_MINIX2
1287static void check2(void) 1287static void check2(void)
1288{ 1288{
1289 memset(inode_count, 0, (INODES + 1) * sizeof(*inode_count)); 1289 memset(inode_count, 0, (INODES + 1) * sizeof(*inode_count));
@@ -1305,7 +1305,7 @@ static void alloc_name_list(void)
1305 name_list[i] = xmalloc(sizeof(char) * BUFSIZ + 1); 1305 name_list[i] = xmalloc(sizeof(char) * BUFSIZ + 1);
1306} 1306}
1307 1307
1308#ifdef BB_FEATURE_CLEAN_UP 1308#ifdef CONFIG_FEATURE_CLEAN_UP
1309/* execute this atexit() to deallocate name_list[] */ 1309/* execute this atexit() to deallocate name_list[] */
1310/* piptigger was here */ 1310/* piptigger was here */
1311static void free_name_list(void) 1311static void free_name_list(void)
@@ -1330,7 +1330,7 @@ extern int fsck_minix_main(int argc, char **argv)
1330 int retcode = 0; 1330 int retcode = 0;
1331 1331
1332 alloc_name_list(); 1332 alloc_name_list();
1333#ifdef BB_FEATURE_CLEAN_UP 1333#ifdef CONFIG_FEATURE_CLEAN_UP
1334 /* Don't bother to free memory. Exit does 1334 /* Don't bother to free memory. Exit does
1335 * that automagically, so we can save a few bytes */ 1335 * that automagically, so we can save a few bytes */
1336 atexit(free_name_list); 1336 atexit(free_name_list);
@@ -1338,7 +1338,7 @@ extern int fsck_minix_main(int argc, char **argv)
1338 1338
1339 if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE) 1339 if (INODE_SIZE * MINIX_INODES_PER_BLOCK != BLOCK_SIZE)
1340 die("bad inode size"); 1340 die("bad inode size");
1341#ifdef BB_FEATURE_MINIX2 1341#ifdef CONFIG_FEATURE_MINIX2
1342 if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE) 1342 if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE)
1343 die("bad v2 inode size"); 1343 die("bad v2 inode size");
1344#endif 1344#endif
@@ -1422,7 +1422,7 @@ extern int fsck_minix_main(int argc, char **argv)
1422 tcsetattr(0, TCSANOW, &tmp); 1422 tcsetattr(0, TCSANOW, &tmp);
1423 termios_set = 1; 1423 termios_set = 1;
1424 } 1424 }
1425#ifdef BB_FEATURE_MINIX2 1425#ifdef CONFIG_FEATURE_MINIX2
1426 if (version2) { 1426 if (version2) {
1427 check_root2(); 1427 check_root2();
1428 check2(); 1428 check2();