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 248658 2013-03-23 20:00:02Z mckusick $");
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 /*
72 * Set file system reserved blocks in used block map.
73 */
74 for (c = 0; c < sblock.fs_ncg; c++) {
75 cgd = cgdmin(&sblock, c);
76 if (c == 0) {
77 i = cgbase(&sblock, c);
78 } else
--- 379 unchanged lines hidden (view full) ---
458 pwarn("EXCESSIVE BAD BLKS I=%lu",
459 (u_long)idesc->id_number);
460 if (preen)
461 printf(" (SKIPPING)\n");
462 else if (reply("CONTINUE") == 0) {
463 ckfini(0);
464 exit(EEXIT);
465 }
466 return (STOP);
467 }
468 }
469 for (nfrags = idesc->id_numfrags; nfrags > 0; blkno++, nfrags--) {
470 if (anyout && chkrange(blkno, 1)) {
471 res = SKIP;
472 } else if (!testbmap(blkno)) {
473 n_blks++;
--- 4 unchanged lines hidden (view full) ---
478 pwarn("EXCESSIVE DUP BLKS I=%lu",
479 (u_long)idesc->id_number);
480 if (preen)
481 printf(" (SKIPPING)\n");
482 else if (reply("CONTINUE") == 0) {
483 ckfini(0);
484 exit(EEXIT);
485 }
486 return (STOP);
487 }
488 new = (struct dups *)Malloc(sizeof(struct dups));
489 if (new == NULL) {
490 pfatal("DUP TABLE OVERFLOW.");
491 if (reply("CONTINUE") == 0) {
492 ckfini(0);
493 exit(EEXIT);
494 }
495 return (STOP);
496 }
497 new->dup = blkno;
498 if (muldup == 0) {
499 duplist = muldup = new;
500 new->next = 0;
501 } else {
502 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 248658 2013-03-23 20:00:02Z mckusick $");
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 /*
72 * Set file system reserved blocks in used block map.
73 */
74 for (c = 0; c < sblock.fs_ncg; c++) {
75 cgd = cgdmin(&sblock, c);
76 if (c == 0) {
77 i = cgbase(&sblock, c);
78 } else
--- 379 unchanged lines hidden (view full) ---
458 pwarn("EXCESSIVE BAD BLKS I=%lu",
459 (u_long)idesc->id_number);
460 if (preen)
461 printf(" (SKIPPING)\n");
462 else if (reply("CONTINUE") == 0) {
463 ckfini(0);
464 exit(EEXIT);
465 }
466 return (STOP);
467 }
468 }
469 for (nfrags = idesc->id_numfrags; nfrags > 0; blkno++, nfrags--) {
470 if (anyout && chkrange(blkno, 1)) {
471 res = SKIP;
472 } else if (!testbmap(blkno)) {
473 n_blks++;
--- 4 unchanged lines hidden (view full) ---
478 pwarn("EXCESSIVE DUP BLKS I=%lu",
479 (u_long)idesc->id_number);
480 if (preen)
481 printf(" (SKIPPING)\n");
482 else if (reply("CONTINUE") == 0) {
483 ckfini(0);
484 exit(EEXIT);
485 }
486 return (STOP);
487 }
488 new = (struct dups *)Malloc(sizeof(struct dups));
489 if (new == NULL) {
490 pfatal("DUP TABLE OVERFLOW.");
491 if (reply("CONTINUE") == 0) {
492 ckfini(0);
493 exit(EEXIT);
494 }
495 return (STOP);
496 }
497 new->dup = blkno;
498 if (muldup == 0) {
499 duplist = muldup = new;
500 new->next = 0;
501 } else {
502 new->next = muldup->next;
--- 15 unchanged lines hidden ---