summaryrefslogtreecommitdiff
path: root/sbin/newfs
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2016-07-23 09:12:34 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2016-07-23 09:12:34 +0000
commit4e427737398c9a4eae6e8784e306e4d39c44a293 (patch)
tree18f3bf67fcb8d1695760448e7c11a39e8e546784 /sbin/newfs
parentc6db28d8f5454012bd16f0e4b382dcf76dd822df (diff)
At n2k16 David Vasek pointed out that FFS partitions on 4K disks are
created with far fewer inodes than DEV_BSIZE devices. Scale the default 'density' value by (sector size)/DEV_BSIZE to create the same number of inodes. Obviously a NO-OP on DEV_BSIZE devices. Thanks David! ok deraadt@
Diffstat (limited to 'sbin/newfs')
-rw-r--r--sbin/newfs/newfs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c
index e0bc0c96612..69f480d320b 100644
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: newfs.c,v 1.106 2016/05/31 16:41:08 deraadt Exp $ */
+/* $OpenBSD: newfs.c,v 1.107 2016/07/23 09:12:33 krw Exp $ */
/* $NetBSD: newfs.c,v 1.20 1996/05/16 07:13:03 thorpej Exp $ */
/*
@@ -482,7 +482,7 @@ havelabel:
bsize = MINIMUM(DFL_BLKSIZE, 8 * fsize);
}
if (density == 0)
- density = NFPI * fsize;
+ density = (NFPI * fsize) / (sectorsize / DEV_BSIZE);
if (minfree < MINFREE && opt != FS_OPTSPACE && reqopt == -1) {
warnx("warning: changing optimization to space "
"because minfree is less than %d%%\n", MINFREE);