From ddd9ad0a5e5eb93c713b58e8158fa03ab1930c79 Mon Sep 17 00:00:00 2001 From: tsutsui Date: Tue, 20 Nov 2007 16:34:37 +0000 Subject: [PATCH] Fix e2fs_itpg calculation. --- sbin/newfs_ext2fs/mke2fs.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sbin/newfs_ext2fs/mke2fs.c b/sbin/newfs_ext2fs/mke2fs.c index c196e53c10fa..485a5e931a6f 100644 --- a/sbin/newfs_ext2fs/mke2fs.c +++ b/sbin/newfs_ext2fs/mke2fs.c @@ -1,4 +1,4 @@ -/* $NetBSD: mke2fs.c,v 1.3 2007/11/19 15:11:50 tsutsui Exp $ */ +/* $NetBSD: mke2fs.c,v 1.4 2007/11/20 16:34:37 tsutsui Exp $ */ /* * Copyright (c) 2007 Izumi Tsutsui. @@ -108,7 +108,7 @@ #if 0 static char sccsid[] = "@(#)mkfs.c 8.11 (Berkeley) 5/3/95"; #else -__RCSID("$NetBSD: mke2fs.c,v 1.3 2007/11/19 15:11:50 tsutsui Exp $"); +__RCSID("$NetBSD: mke2fs.c,v 1.4 2007/11/20 16:34:37 tsutsui Exp $"); #endif #endif /* not lint */ @@ -329,12 +329,11 @@ mke2fs(const char *fsys, int fi, int fo) blocks_lastcg = blocks_per_cg; blocks_gd = howmany(sizeof(struct ext2_gd) * ncg, bsize); inodes_per_cg = num_inodes / ncg; - iblocks_per_cg = - howmany(EXT2_DINODE_SIZE * inodes_per_cg, bsize); } /* inodes_per_cg should be a multiple of 8 for bitmap ops */ inodes_per_cg = rounddown(inodes_per_cg, NBBY); num_inodes = inodes_per_cg * ncg; + iblocks_per_cg = howmany(EXT2_DINODE_SIZE * inodes_per_cg, bsize); /* XXX: probably we should check these adjusted values again */