From ac3df562c9131e454c0d2be63e8e0e9fa269fc63 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 3 May 2007 20:11:56 +0000 Subject: Update CGSIZE macro so that it is no longer based on fs_cpg. This was part of the ffs2 changes but was not committed earlier in order to make the userland and kernel changes independent. NOTE: the change to newfs require an updated fs.h; building an updated newfs with the old fs.h may result in a broken filesystem. OK otto@ --- sbin/newfs/mkfs.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'sbin/newfs') diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 900fb1a30a4..76db8bf2af2 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkfs.c,v 1.58 2007/04/23 10:18:30 pedro Exp $ */ +/* $OpenBSD: mkfs.c,v 1.59 2007/05/03 20:11:55 millert Exp $ */ /* $NetBSD: mkfs.c,v 1.25 1995/06/18 21:35:38 cgd Exp $ */ /* @@ -341,7 +341,6 @@ mkfs(struct partition *pp, char *fsys, int fi, int fo, mode_t mfsmode, if (sblock.fs_fpg < minfpg) sblock.fs_fpg = minfpg; - sblock.fs_spc = sblock.fs_fpg * sblock.fs_nspf; sblock.fs_ipg = roundup(howmany(sblock.fs_fpg, fragsperinode), INOPB(&sblock)); @@ -371,9 +370,7 @@ mkfs(struct partition *pp, char *fsys, int fi, int fo, mode_t mfsmode, * grow any larger, the number of cylinder groups drops below * mincylgrps, or we reach the requested size. */ - for (; sblock.fs_fpg < maxblkspercg; - sblock.fs_fpg += sblock.fs_frag, - sblock.fs_spc = sblock.fs_fpg * sblock.fs_nspf) { + for (; sblock.fs_fpg < maxblkspercg; sblock.fs_fpg += sblock.fs_frag) { sblock.fs_ipg = roundup(howmany(sblock.fs_fpg, fragsperinode), INOPB(&sblock)); @@ -387,7 +384,6 @@ mkfs(struct partition *pp, char *fsys, int fi, int fo, mode_t mfsmode, break; sblock.fs_fpg -= sblock.fs_frag; - sblock.fs_spc = sblock.fs_fpg * sblock.fs_nspf; sblock.fs_ipg = roundup(howmany(sblock.fs_fpg, fragsperinode), INOPB(&sblock)); @@ -414,7 +410,6 @@ mkfs(struct partition *pp, char *fsys, int fi, int fo, mode_t mfsmode, break; sblock.fs_fpg -= sblock.fs_frag; - sblock.fs_spc = sblock.fs_fpg * sblock.fs_nspf; sblock.fs_ipg = roundup(howmany(sblock.fs_fpg, fragsperinode), INOPB(&sblock)); } @@ -428,6 +423,7 @@ mkfs(struct partition *pp, char *fsys, int fi, int fo, mode_t mfsmode, * Back to filling superblock fields. */ if (Oflag <= 1) { + sblock.fs_spc = sblock.fs_fpg * sblock.fs_nspf; sblock.fs_nsect = sblock.fs_spc; sblock.fs_npsect = sblock.fs_spc; sblock.fs_ncyl = sblock.fs_ncg; -- cgit v1.2.3