summaryrefslogtreecommitdiffstats
path: root/sbin/bsdlabel
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2003-10-05 19:40:02 +0000
committeriedowse <iedowse@FreeBSD.org>2003-10-05 19:40:02 +0000
commit24155b3ff16b48ef47ef5d677c0e73d9c3d150f3 (patch)
tree6f6e3c0569c6ec004eeb6ab8d6aaf25b1b834e6d /sbin/bsdlabel
parente581cb10694481a24806fdc31f96cd5584bc1e2b (diff)
downloadFreeBSD-src-24155b3ff16b48ef47ef5d677c0e73d9c3d150f3.zip
FreeBSD-src-24155b3ff16b48ef47ef5d677c0e73d9c3d150f3.tar.gz
Remove the hardcoded default block/frag/cpg values from bsdlabel
and the logic for setting them according to the partition size. Instead, unspecified filesystem values are left at 0 so that newfs will use its own defaults. It just caused confusion to have the defaults duplicated in two different places. Reviewed by: phk
Diffstat (limited to 'sbin/bsdlabel')
-rw-r--r--sbin/bsdlabel/bsdlabel.c49
1 files changed, 5 insertions, 44 deletions
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c
index d167063..3227d7d 100644
--- a/sbin/bsdlabel/bsdlabel.c
+++ b/sbin/bsdlabel/bsdlabel.c
@@ -78,15 +78,6 @@ __FBSDID("$FreeBSD$");
#include "pathnames.h"
-/* FIX! These are too low, but are traditional */
-#define DEFAULT_NEWFS_BLOCK 8192U
-#define DEFAULT_NEWFS_FRAG 1024U
-#define DEFAULT_NEWFS_CPG 16U
-
-#define BIG_NEWFS_BLOCK 16384U
-#define BIG_NEWFS_FRAG 2048U
-#define BIG_NEWFS_CPG 64U
-
static void makelabel(const char *, struct disklabel *);
static int writelabel(void);
static int readlabel(int flag);
@@ -988,50 +979,20 @@ getasciipartspec(char *tp, struct disklabel *lp, int part, int lineno)
switch (pp->p_fstype) {
case FS_UNUSED:
- /*
- * allow us to accept defaults for
- * fsize/frag/cpg
- */
- if (tp) {
- NXTNUM(pp->p_fsize);
- if (pp->p_fsize == 0)
- break;
- NXTNUM(v);
- pp->p_frag = v / pp->p_fsize;
- }
- /* else default to 0's */
- break;
-
- /* These happen to be the same */
case FS_BSDFFS:
case FS_BSDLFS:
+ /* accept defaults for fsize/frag/cpg */
if (tp) {
NXTNUM(pp->p_fsize);
if (pp->p_fsize == 0)
break;
NXTNUM(v);
pp->p_frag = v / pp->p_fsize;
- NXTNUM(pp->p_cpg);
- } else {
- /*
- * FIX! poor attempt at adaptive
- */
- /* 1 GB */
- if (pp->p_size < 1024*1024*1024 / lp->d_secsize) {
- /*
- * FIX! These are too low, but are traditional
- */
- pp->p_fsize = DEFAULT_NEWFS_FRAG;
- pp->p_frag = DEFAULT_NEWFS_BLOCK /
- DEFAULT_NEWFS_FRAG;
- pp->p_cpg = DEFAULT_NEWFS_CPG;
- } else {
- pp->p_fsize = BIG_NEWFS_FRAG;
- pp->p_frag = BIG_NEWFS_BLOCK /
- BIG_NEWFS_FRAG;
- pp->p_cpg = BIG_NEWFS_CPG;
- }
+ if (tp != NULL)
+ NXTNUM(pp->p_cpg);
}
+ /* else default to 0's */
+ break;
default:
break;
}
OpenPOWER on IntegriCloud