1/*
2 * Copyright (c) 1980, 1986, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 19 unchanged lines hidden (view full) ---
28 */
29
30#if 0
31#ifndef lint
32static const char sccsid[] = "@(#)pass1.c 8.6 (Berkeley) 4/28/95";
33#endif /* not lint */
34#endif
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: stable/10/sbin/fsck_ffs/pass1.c 260178 2014-01-02 01:44:14Z scottl $");
37
38#include <sys/param.h>
39#include <sys/stat.h>
40#include <sys/sysctl.h>
41
42#include <ufs/ufs/dinode.h>
43#include <ufs/ufs/dir.h>
44#include <ufs/ffs/fs.h>
--- 18 unchanged lines hidden (view full) ---
63 struct inodesc idesc;
64 struct bufarea *cgbp;
65 struct cg *cgp;
66 ino_t inumber, inosused, mininos;
67 ufs2_daddr_t i, cgd;
68 u_int8_t *cp;
69 int c, rebuildcg;
70
71 badblk = dupblk = lastino = 0;
72
73 /*
74 * Set file system reserved blocks in used block map.
75 */
76 for (c = 0; c < sblock.fs_ncg; c++) {
77 cgd = cgdmin(&sblock, c);
78 if (c == 0) {
79 i = cgbase(&sblock, c);
80 } else
--- 379 unchanged lines hidden (view full) ---
460 pwarn("EXCESSIVE BAD BLKS I=%lu",
461 (u_long)idesc->id_number);
462 if (preen)
463 printf(" (SKIPPING)\n");
464 else if (reply("CONTINUE") == 0) {
465 ckfini(0);
466 exit(EEXIT);
467 }
468 rerun = 1;
469 return (STOP);
470 }
471 }
472 for (nfrags = idesc->id_numfrags; nfrags > 0; blkno++, nfrags--) {
473 if (anyout && chkrange(blkno, 1)) {
474 res = SKIP;
475 } else if (!testbmap(blkno)) {
476 n_blks++;
--- 4 unchanged lines hidden (view full) ---
481 pwarn("EXCESSIVE DUP BLKS I=%lu",
482 (u_long)idesc->id_number);
483 if (preen)
484 printf(" (SKIPPING)\n");
485 else if (reply("CONTINUE") == 0) {
486 ckfini(0);
487 exit(EEXIT);
488 }
489 rerun = 1;
490 return (STOP);
491 }
492 new = (struct dups *)Malloc(sizeof(struct dups));
493 if (new == NULL) {
494 pfatal("DUP TABLE OVERFLOW.");
495 if (reply("CONTINUE") == 0) {
496 ckfini(0);
497 exit(EEXIT);
498 }
499 rerun = 1;
500 return (STOP);
501 }
502 new->dup = blkno;
503 if (muldup == 0) {
504 duplist = muldup = new;
505 new->next = 0;
506 } else {
507 new->next = muldup->next;
--- 15 unchanged lines hidden ---
2 * Copyright (c) 1980, 1986, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
--- 19 unchanged lines hidden (view full) ---
28 */
29
30#if 0
31#ifndef lint
32static const char sccsid[] = "@(#)pass1.c 8.6 (Berkeley) 4/28/95";
33#endif /* not lint */
34#endif
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: stable/10/sbin/fsck_ffs/pass1.c 260178 2014-01-02 01:44:14Z scottl $");
37
38#include <sys/param.h>
39#include <sys/stat.h>
40#include <sys/sysctl.h>
41
42#include <ufs/ufs/dinode.h>
43#include <ufs/ufs/dir.h>
44#include <ufs/ffs/fs.h>
--- 18 unchanged lines hidden (view full) ---
63 struct inodesc idesc;
64 struct bufarea *cgbp;
65 struct cg *cgp;
66 ino_t inumber, inosused, mininos;
67 ufs2_daddr_t i, cgd;
68 u_int8_t *cp;
69 int c, rebuildcg;
70
71 badblk = dupblk = lastino = 0;
72
73 /*
74 * Set file system reserved blocks in used block map.
75 */
76 for (c = 0; c < sblock.fs_ncg; c++) {
77 cgd = cgdmin(&sblock, c);
78 if (c == 0) {
79 i = cgbase(&sblock, c);
80 } else
--- 379 unchanged lines hidden (view full) ---
460 pwarn("EXCESSIVE BAD BLKS I=%lu",
461 (u_long)idesc->id_number);
462 if (preen)
463 printf(" (SKIPPING)\n");
464 else if (reply("CONTINUE") == 0) {
465 ckfini(0);
466 exit(EEXIT);
467 }
468 rerun = 1;
469 return (STOP);
470 }
471 }
472 for (nfrags = idesc->id_numfrags; nfrags > 0; blkno++, nfrags--) {
473 if (anyout && chkrange(blkno, 1)) {
474 res = SKIP;
475 } else if (!testbmap(blkno)) {
476 n_blks++;
--- 4 unchanged lines hidden (view full) ---
481 pwarn("EXCESSIVE DUP BLKS I=%lu",
482 (u_long)idesc->id_number);
483 if (preen)
484 printf(" (SKIPPING)\n");
485 else if (reply("CONTINUE") == 0) {
486 ckfini(0);
487 exit(EEXIT);
488 }
489 rerun = 1;
490 return (STOP);
491 }
492 new = (struct dups *)Malloc(sizeof(struct dups));
493 if (new == NULL) {
494 pfatal("DUP TABLE OVERFLOW.");
495 if (reply("CONTINUE") == 0) {
496 ckfini(0);
497 exit(EEXIT);
498 }
499 rerun = 1;
500 return (STOP);
501 }
502 new->dup = blkno;
503 if (muldup == 0) {
504 duplist = muldup = new;
505 new->next = 0;
506 } else {
507 new->next = muldup->next;
--- 15 unchanged lines hidden ---