From e7bce8e3476df3f71e06030c07659e0a8be9214c Mon Sep 17 00:00:00 2001 From: deraadt Date: Mon, 29 Jan 1996 01:37:11 +0000 Subject: [PATCH] use fs_csaddr to find the cg summary area; from mouse@collatz.mccrim.mcgill.edu; netbsd pr#1366 --- sbin/fsck/pass1.c | 13 ++++++++----- sbin/fsck_ffs/pass1.c | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/sbin/fsck/pass1.c b/sbin/fsck/pass1.c index a512575c240..fc1b664856e 100644 --- a/sbin/fsck/pass1.c +++ b/sbin/fsck/pass1.c @@ -1,4 +1,4 @@ -/* $NetBSD: pass1.c,v 1.13 1995/03/18 14:55:49 cgd Exp $ */ +/* $NetBSD: pass1.c,v 1.14 1996/01/18 21:55:27 mycroft Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)pass1.c 8.1 (Berkeley) 6/5/93"; #else -static char rcsid[] = "$NetBSD: pass1.c,v 1.13 1995/03/18 14:55:49 cgd Exp $"; +static char rcsid[] = "$NetBSD: pass1.c,v 1.14 1996/01/18 21:55:27 mycroft Exp $"; #endif #endif /* not lint */ @@ -72,14 +72,17 @@ pass1() */ for (c = 0; c < sblock.fs_ncg; c++) { cgd = cgdmin(&sblock, c); - if (c == 0) { + if (c == 0) i = cgbase(&sblock, c); - cgd += howmany(sblock.fs_cssize, sblock.fs_fsize); - } else + else i = cgsblock(&sblock, c); for (; i < cgd; i++) setbmap(i); } + i = sblock.fs_csaddr; + cgd = i + howmany(sblock.fs_cssize, sblock.fs_fsize); + for (; i < cgd; i++) + setbmap(i); /* * Find all allocated blocks. */ diff --git a/sbin/fsck_ffs/pass1.c b/sbin/fsck_ffs/pass1.c index a512575c240..fc1b664856e 100644 --- a/sbin/fsck_ffs/pass1.c +++ b/sbin/fsck_ffs/pass1.c @@ -1,4 +1,4 @@ -/* $NetBSD: pass1.c,v 1.13 1995/03/18 14:55:49 cgd Exp $ */ +/* $NetBSD: pass1.c,v 1.14 1996/01/18 21:55:27 mycroft Exp $ */ /* * Copyright (c) 1980, 1986, 1993 @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)pass1.c 8.1 (Berkeley) 6/5/93"; #else -static char rcsid[] = "$NetBSD: pass1.c,v 1.13 1995/03/18 14:55:49 cgd Exp $"; +static char rcsid[] = "$NetBSD: pass1.c,v 1.14 1996/01/18 21:55:27 mycroft Exp $"; #endif #endif /* not lint */ @@ -72,14 +72,17 @@ pass1() */ for (c = 0; c < sblock.fs_ncg; c++) { cgd = cgdmin(&sblock, c); - if (c == 0) { + if (c == 0) i = cgbase(&sblock, c); - cgd += howmany(sblock.fs_cssize, sblock.fs_fsize); - } else + else i = cgsblock(&sblock, c); for (; i < cgd; i++) setbmap(i); } + i = sblock.fs_csaddr; + cgd = i + howmany(sblock.fs_cssize, sblock.fs_fsize); + for (; i < cgd; i++) + setbmap(i); /* * Find all allocated blocks. */ -- 2.20.1