From 93f5b895c186d356530516da21c9603cb8204130 Mon Sep 17 00:00:00 2001 From: mckusick Date: Fri, 15 Nov 2002 23:50:14 +0000 Subject: Properly calculate the initial number of fragments in a large filesystem. Sponsored by: DARPA & NAI Labs. --- sbin/newfs/mkfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sbin/newfs/mkfs.c') diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index ff37368..2de9b43 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -405,7 +405,8 @@ mkfs(struct partition *pp, char *fsys) howmany(csfrags, sblock.fs_frag); sblock.fs_cstotal.cs_nffree = fragnum(&sblock, sblock.fs_size) + - (csfrags > 0 ? sblock.fs_frag - csfrags : 0); + (numfrags(&sblock, csfrags) > 0 ? + sblock.fs_frag - numfrags(&sblock, csfrags) : 0); sblock.fs_cstotal.cs_nifree = sblock.fs_ncg * sblock.fs_ipg - ROOTINO; sblock.fs_cstotal.cs_ndir = 0; sblock.fs_dsize -= csfrags; -- cgit v1.1