From cdbcf1b5b75cdfd05bb5395196f0dfebb09b612e Mon Sep 17 00:00:00 2001 From: Kirk McKusick Date: Tue, 2 Aug 1983 01:45:45 -0800 Subject: [PATCH] fix calculation of initial block counts SCCS-vsn: sbin/newfs/mkfs.c 2.15 --- usr/src/sbin/newfs/mkfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr/src/sbin/newfs/mkfs.c b/usr/src/sbin/newfs/mkfs.c index 3315abc6fe..d224d06341 100644 --- a/usr/src/sbin/newfs/mkfs.c +++ b/usr/src/sbin/newfs/mkfs.c @@ -1,5 +1,5 @@ #ifndef lint -static char *sccsid = "@(#)mkfs.c 2.14 (Berkeley) %G%"; +static char *sccsid = "@(#)mkfs.c 2.15 (Berkeley) %G%"; #endif /* @@ -668,7 +668,7 @@ fsinit() node.i_nlink = 2; node.i_size = sblock.fs_bsize; node.i_db[0] = alloc(node.i_size, node.i_mode); - node.i_blocks = howmany(node.i_size, DEV_BSIZE); + node.i_blocks = btodb(fragroundup(&sblock, node.i_size)); wtfs(fsbtodb(&sblock, node.i_db[0]), node.i_size, buf); iput(&node); /* @@ -679,7 +679,7 @@ fsinit() node.i_nlink = PREDEFDIR; node.i_size = makedir(root_dir, PREDEFDIR); node.i_db[0] = alloc(sblock.fs_fsize, node.i_mode); - node.i_blocks = howmany(node.i_size, DEV_BSIZE); + node.i_blocks = btodb(fragroundup(&sblock, node.i_size)); wtfs(fsbtodb(&sblock, node.i_db[0]), sblock.fs_fsize, buf); iput(&node); } -- 2.20.1