Use fs_csaddr to find the cg summary area. From der Mouse, PR 1366.

This commit is contained in:
mycroft 1996-01-18 21:55:27 +00:00
parent fceadcfbd1
commit afdfe1b51f
2 changed files with 16 additions and 10 deletions

View File

@ -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 * Copyright (c) 1980, 1986, 1993
@ -37,7 +37,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)pass1.c 8.1 (Berkeley) 6/5/93"; static char sccsid[] = "@(#)pass1.c 8.1 (Berkeley) 6/5/93";
#else #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
#endif /* not lint */ #endif /* not lint */
@ -72,14 +72,17 @@ pass1()
*/ */
for (c = 0; c < sblock.fs_ncg; c++) { for (c = 0; c < sblock.fs_ncg; c++) {
cgd = cgdmin(&sblock, c); cgd = cgdmin(&sblock, c);
if (c == 0) { if (c == 0)
i = cgbase(&sblock, c); i = cgbase(&sblock, c);
cgd += howmany(sblock.fs_cssize, sblock.fs_fsize); else
} else
i = cgsblock(&sblock, c); i = cgsblock(&sblock, c);
for (; i < cgd; i++) for (; i < cgd; i++)
setbmap(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. * Find all allocated blocks.
*/ */

View File

@ -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 * Copyright (c) 1980, 1986, 1993
@ -37,7 +37,7 @@
#if 0 #if 0
static char sccsid[] = "@(#)pass1.c 8.1 (Berkeley) 6/5/93"; static char sccsid[] = "@(#)pass1.c 8.1 (Berkeley) 6/5/93";
#else #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
#endif /* not lint */ #endif /* not lint */
@ -72,14 +72,17 @@ pass1()
*/ */
for (c = 0; c < sblock.fs_ncg; c++) { for (c = 0; c < sblock.fs_ncg; c++) {
cgd = cgdmin(&sblock, c); cgd = cgdmin(&sblock, c);
if (c == 0) { if (c == 0)
i = cgbase(&sblock, c); i = cgbase(&sblock, c);
cgd += howmany(sblock.fs_cssize, sblock.fs_fsize); else
} else
i = cgsblock(&sblock, c); i = cgsblock(&sblock, c);
for (; i < cgd; i++) for (; i < cgd; i++)
setbmap(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. * Find all allocated blocks.
*/ */