aboutsummaryrefslogtreecommitdiff
path: root/sbin/bsdlabel/bsdlabel.c
diff options
context:
space:
mode:
authorIan Dowse <iedowse@FreeBSD.org>2003-10-05 19:40:02 +0000
committerIan Dowse <iedowse@FreeBSD.org>2003-10-05 19:40:02 +0000
commit640c9cb2972ea57eca3df01dc52302222218b8db (patch)
tree6f6e3c0569c6ec004eeb6ab8d6aaf25b1b834e6d /sbin/bsdlabel/bsdlabel.c
parent4de5d90c8eef537f17eaaf2c6722108a7d0b4ee1 (diff)
downloadsrc-640c9cb2972ea57eca3df01dc52302222218b8db.tar.gz
src-640c9cb2972ea57eca3df01dc52302222218b8db.zip
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
Notes
Notes: svn path=/head/; revision=120821
Diffstat (limited to 'sbin/bsdlabel/bsdlabel.c')
-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 d1670635007d..3227d7d20147 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;
}