summaryrefslogtreecommitdiff
path: root/util-linux/fsck_minix.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-01-03 00:45:05 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-01-03 00:45:05 +0000
commit73464ce53d0f83f7661d03ec831a538fb9229507 (patch)
tree6b0e078a239e15ca77e98394c39c45c61c879535 /util-linux/fsck_minix.c
parentaa95959cb81b72d37ce1f20606f97e064bbd2bfe (diff)
downloadbusybox-w32-73464ce53d0f83f7661d03ec831a538fb9229507.tar.gz
busybox-w32-73464ce53d0f83f7661d03ec831a538fb9229507.tar.bz2
busybox-w32-73464ce53d0f83f7661d03ec831a538fb9229507.zip
fbset: move variable from data to bss
fsck_minix: fix fallout
Diffstat (limited to 'util-linux/fsck_minix.c')
-rw-r--r--util-linux/fsck_minix.c48
1 files changed, 24 insertions, 24 deletions
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index ebfd645f2..2d5562e87 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -174,7 +174,7 @@ static char *zone_map;
174static unsigned char *inode_count; 174static unsigned char *inode_count;
175static unsigned char *zone_count; 175static unsigned char *zone_count;
176 176
177static int bit(char *a, unsigned int i) 177static int bit(char *a, unsigned i)
178{ 178{
179 return (a[i >> 3] & (1<<(i & 7))) != 0; 179 return (a[i >> 3] & (1<<(i & 7))) != 0;
180} 180}
@@ -189,9 +189,9 @@ static int bit(char *a, unsigned int i)
189#define unmark_zone(x) (clrbit(zone_map,(x)-FIRSTZONE+1),changed=1) 189#define unmark_zone(x) (clrbit(zone_map,(x)-FIRSTZONE+1),changed=1)
190 190
191 191
192static void recursive_check(unsigned int ino); 192static void recursive_check(unsigned ino);
193#if ENABLE_FEATURE_MINIX2 193#if ENABLE_FEATURE_MINIX2
194static void recursive_check2(unsigned int ino); 194static void recursive_check2(unsigned ino);
195#endif 195#endif
196 196
197static void leave(int) ATTRIBUTE_NORETURN; 197static void leave(int) ATTRIBUTE_NORETURN;
@@ -381,7 +381,7 @@ static int check_zone_nr(uint16_t *nr, smallint *corrected)
381/* 381/*
382 * read-block reads block nr into the buffer at addr. 382 * read-block reads block nr into the buffer at addr.
383 */ 383 */
384static void read_block(unsigned int nr, char *addr) 384static void read_block(unsigned nr, char *addr)
385{ 385{
386 if (!nr) { 386 if (!nr) {
387 memset(addr, 0, BLOCK_SIZE); 387 memset(addr, 0, BLOCK_SIZE);
@@ -403,7 +403,7 @@ static void read_block(unsigned int nr, char *addr)
403/* 403/*
404 * write_block writes block nr to disk. 404 * write_block writes block nr to disk.
405 */ 405 */
406static void write_block(unsigned int nr, char *addr) 406static void write_block(unsigned nr, char *addr)
407{ 407{
408 if (!nr) 408 if (!nr)
409 return; 409 return;
@@ -427,7 +427,7 @@ static void write_block(unsigned int nr, char *addr)
427 * It sets 'changed' if the inode has needed changing, and re-writes 427 * It sets 'changed' if the inode has needed changing, and re-writes
428 * any indirect blocks with errors. 428 * any indirect blocks with errors.
429 */ 429 */
430static int map_block(struct minix1_inode *inode, unsigned int blknr) 430static int map_block(struct minix1_inode *inode, unsigned blknr)
431{ 431{
432 uint16_t ind[BLOCK_SIZE >> 1]; 432 uint16_t ind[BLOCK_SIZE >> 1];
433 uint16_t dind[BLOCK_SIZE >> 1]; 433 uint16_t dind[BLOCK_SIZE >> 1];
@@ -463,7 +463,7 @@ static int map_block(struct minix1_inode *inode, unsigned int blknr)
463} 463}
464 464
465#if ENABLE_FEATURE_MINIX2 465#if ENABLE_FEATURE_MINIX2
466static int map_block2(struct minix2_inode *inode, unsigned int blknr) 466static int map_block2(struct minix2_inode *inode, unsigned blknr)
467{ 467{
468 uint32_t ind[BLOCK_SIZE >> 2]; 468 uint32_t ind[BLOCK_SIZE >> 2];
469 uint32_t dind[BLOCK_SIZE >> 2]; 469 uint32_t dind[BLOCK_SIZE >> 2];
@@ -643,7 +643,7 @@ static void read_tables(void)
643 } 643 }
644} 644}
645 645
646static struct minix1_inode *get_inode(unsigned int nr) 646static struct minix1_inode *get_inode(unsigned nr)
647{ 647{
648 struct minix1_inode *inode; 648 struct minix1_inode *inode;
649 649
@@ -653,7 +653,7 @@ static struct minix1_inode *get_inode(unsigned int nr)
653 inode = Inode1 + nr; 653 inode = Inode1 + nr;
654 if (!inode_count[nr]) { 654 if (!inode_count[nr]) {
655 if (!inode_in_use(nr)) { 655 if (!inode_in_use(nr)) {
656 printf("Inode1 %d is marked as 'unused', but it is used " 656 printf("Inode %d is marked as 'unused', but it is used "
657 "for file '%s'\n", nr, current_name); 657 "for file '%s'\n", nr, current_name);
658 if (repair) { 658 if (repair) {
659 if (ask("Mark as 'in use'", 1)) 659 if (ask("Mark as 'in use'", 1))
@@ -689,7 +689,7 @@ static struct minix1_inode *get_inode(unsigned int nr)
689} 689}
690 690
691#if ENABLE_FEATURE_MINIX2 691#if ENABLE_FEATURE_MINIX2
692static struct minix2_inode *get_inode2(unsigned int nr) 692static struct minix2_inode *get_inode2(unsigned nr)
693{ 693{
694 struct minix2_inode *inode; 694 struct minix2_inode *inode;
695 695
@@ -699,7 +699,7 @@ static struct minix2_inode *get_inode2(unsigned int nr)
699 inode = Inode2 + nr; 699 inode = Inode2 + nr;
700 if (!inode_count[nr]) { 700 if (!inode_count[nr]) {
701 if (!inode_in_use(nr)) { 701 if (!inode_in_use(nr)) {
702 printf("Inode1 %d is marked as 'unused', but it is used " 702 printf("Inode %d is marked as 'unused', but it is used "
703 "for file '%s'\n", nr, current_name); 703 "for file '%s'\n", nr, current_name);
704 if (repair) { 704 if (repair) {
705 if (ask("Mark as 'in use'", 1)) 705 if (ask("Mark as 'in use'", 1))
@@ -905,7 +905,7 @@ static void add_zone_tind2(uint32_t *znr, smallint *corrected)
905} 905}
906#endif 906#endif
907 907
908static void check_zones(unsigned int i) 908static void check_zones(unsigned i)
909{ 909{
910 struct minix1_inode *inode; 910 struct minix1_inode *inode;
911 911
@@ -923,7 +923,7 @@ static void check_zones(unsigned int i)
923} 923}
924 924
925#if ENABLE_FEATURE_MINIX2 925#if ENABLE_FEATURE_MINIX2
926static void check_zones2(unsigned int i) 926static void check_zones2(unsigned i)
927{ 927{
928 struct minix2_inode *inode; 928 struct minix2_inode *inode;
929 929
@@ -943,7 +943,7 @@ static void check_zones2(unsigned int i)
943} 943}
944#endif 944#endif
945 945
946static void check_file(struct minix1_inode *dir, unsigned int offset) 946static void check_file(struct minix1_inode *dir, unsigned offset)
947{ 947{
948 static char blk[BLOCK_SIZE]; 948 static char blk[BLOCK_SIZE];
949 struct minix1_inode *inode; 949 struct minix1_inode *inode;
@@ -994,7 +994,7 @@ static void check_file(struct minix1_inode *dir, unsigned int offset)
994} 994}
995 995
996#if ENABLE_FEATURE_MINIX2 996#if ENABLE_FEATURE_MINIX2
997static void check_file2(struct minix2_inode *dir, unsigned int offset) 997static void check_file2(struct minix2_inode *dir, unsigned offset)
998{ 998{
999 static char blk[BLOCK_SIZE]; 999 static char blk[BLOCK_SIZE];
1000 struct minix2_inode *inode; 1000 struct minix2_inode *inode;
@@ -1045,10 +1045,10 @@ static void check_file2(struct minix2_inode *dir, unsigned int offset)
1045} 1045}
1046#endif 1046#endif
1047 1047
1048static void recursive_check(unsigned int ino) 1048static void recursive_check(unsigned ino)
1049{ 1049{
1050 struct minix1_inode *dir; 1050 struct minix1_inode *dir;
1051 unsigned int offset; 1051 unsigned offset;
1052 1052
1053 dir = Inode1 + ino; 1053 dir = Inode1 + ino;
1054 if (!S_ISDIR(dir->i_mode)) 1054 if (!S_ISDIR(dir->i_mode))
@@ -1062,10 +1062,10 @@ static void recursive_check(unsigned int ino)
1062} 1062}
1063 1063
1064#if ENABLE_FEATURE_MINIX2 1064#if ENABLE_FEATURE_MINIX2
1065static void recursive_check2(unsigned int ino) 1065static void recursive_check2(unsigned ino)
1066{ 1066{
1067 struct minix2_inode *dir; 1067 struct minix2_inode *dir;
1068 unsigned int offset; 1068 unsigned offset;
1069 1069
1070 dir = Inode2 + ino; 1070 dir = Inode2 + ino;
1071 if (!S_ISDIR(dir->i_mode)) 1071 if (!S_ISDIR(dir->i_mode))
@@ -1094,7 +1094,7 @@ static void check_counts(void)
1094 1094
1095 for (i = 1; i <= INODES; i++) { 1095 for (i = 1; i <= INODES; i++) {
1096 if (warn_mode && Inode1[i].i_mode && !inode_in_use(i)) { 1096 if (warn_mode && Inode1[i].i_mode && !inode_in_use(i)) {
1097 printf("Inode1 %d has non-zero mode. ", i); 1097 printf("Inode %d has non-zero mode. ", i);
1098 if (ask("Clear", 1)) { 1098 if (ask("Clear", 1)) {
1099 Inode1[i].i_mode = 0; 1099 Inode1[i].i_mode = 0;
1100 changed = 1; 1100 changed = 1;
@@ -1109,12 +1109,12 @@ static void check_counts(void)
1109 continue; 1109 continue;
1110 } 1110 }
1111 if (!inode_in_use(i)) { 1111 if (!inode_in_use(i)) {
1112 printf("Inode1 %d is used, but marked as 'unused' in the bitmap. ", i); 1112 printf("Inode %d is used, but marked as 'unused' in the bitmap. ", i);
1113 if (ask("Set", 1)) 1113 if (ask("Set", 1))
1114 mark_inode(i); 1114 mark_inode(i);
1115 } 1115 }
1116 if (Inode1[i].i_nlinks != inode_count[i]) { 1116 if (Inode1[i].i_nlinks != inode_count[i]) {
1117 printf("Inode1 %d (mode=%07o), i_nlinks=%d, counted=%d. ", 1117 printf("Inode %d (mode=%07o), i_nlinks=%d, counted=%d. ",
1118 i, Inode1[i].i_mode, Inode1[i].i_nlinks, inode_count[i]); 1118 i, Inode1[i].i_mode, Inode1[i].i_nlinks, inode_count[i]);
1119 if (ask("Set i_nlinks to count", 1)) { 1119 if (ask("Set i_nlinks to count", 1)) {
1120 Inode1[i].i_nlinks = inode_count[i]; 1120 Inode1[i].i_nlinks = inode_count[i];
@@ -1145,7 +1145,7 @@ static void check_counts2(void)
1145 1145
1146 for (i = 1; i <= INODES; i++) { 1146 for (i = 1; i <= INODES; i++) {
1147 if (warn_mode && Inode2[i].i_mode && !inode_in_use(i)) { 1147 if (warn_mode && Inode2[i].i_mode && !inode_in_use(i)) {
1148 printf("Inode1 %d has non-zero mode. ", i); 1148 printf("Inode %d has non-zero mode. ", i);
1149 if (ask("Clear", 1)) { 1149 if (ask("Clear", 1)) {
1150 Inode2[i].i_mode = 0; 1150 Inode2[i].i_mode = 0;
1151 changed = 1; 1151 changed = 1;
@@ -1160,7 +1160,7 @@ static void check_counts2(void)
1160 continue; 1160 continue;
1161 } 1161 }
1162 if (!inode_in_use(i)) { 1162 if (!inode_in_use(i)) {
1163 printf("Inode1 %d is used, but marked as 'unused' in the bitmap. ", i); 1163 printf("Inode %d is used, but marked as 'unused' in the bitmap. ", i);
1164 if (ask("Set", 1)) 1164 if (ask("Set", 1))
1165 mark_inode(i); 1165 mark_inode(i);
1166 } 1166 }