diff options
author | Pedro Martelletto <pedro@cvs.openbsd.org> | 2006-03-09 13:35:03 +0000 |
---|---|---|
committer | Pedro Martelletto <pedro@cvs.openbsd.org> | 2006-03-09 13:35:03 +0000 |
commit | 164a6b1ad593049aa35d3d58446a7a517a3e75eb (patch) | |
tree | a1c2195d552e950ef96fb1fd3bd19f6ebcf93c2c /sbin/newfs | |
parent | dce26f6ae64a51315f5998964911ac7b83859ced (diff) |
Remove option -n from newfs as well as all references to fs_postbl()
Various testing for a while, okay krw@
Diffstat (limited to 'sbin/newfs')
-rw-r--r-- | sbin/newfs/mkfs.c | 56 | ||||
-rw-r--r-- | sbin/newfs/newfs.8 | 5 | ||||
-rw-r--r-- | sbin/newfs/newfs.c | 24 |
3 files changed, 24 insertions, 61 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 1c7629e0b97..27656019802 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkfs.c,v 1.49 2005/12/19 15:18:01 pedro Exp $ */ +/* $OpenBSD: mkfs.c,v 1.50 2006/03/09 13:35:02 pedro Exp $ */ /* $NetBSD: mkfs.c,v 1.25 1995/06/18 21:35:38 cgd Exp $ */ /* @@ -34,7 +34,7 @@ #if 0 static char sccsid[] = "@(#)mkfs.c 8.3 (Berkeley) 2/3/94"; #else -static char rcsid[] = "$OpenBSD: mkfs.c,v 1.49 2005/12/19 15:18:01 pedro Exp $"; +static char rcsid[] = "$OpenBSD: mkfs.c,v 1.50 2006/03/09 13:35:02 pedro Exp $"; #endif #endif /* not lint */ @@ -76,6 +76,17 @@ static char rcsid[] = "$OpenBSD: mkfs.c,v 1.49 2005/12/19 15:18:01 pedro Exp $"; #define POWEROF2(num) (((num) & ((num) - 1)) == 0) /* + * For each cylinder we keep track of the availability of blocks at different + * rotational positions, so that we can lay out the data to be picked + * up with minimum rotational latency. NRPOS is the default number of + * rotational positions that we distinguish. With NRPOS of 8 the resolution + * of our summary information is 2ms for a typical 3600 rpm drive. Caching + * and zoning pretty much defeats rotational optimization, so we now use a + * default of 1. + */ +#define NRPOS 1 /* number distinct rotational positions */ + +/* * variables set up by front end. */ extern int mfs; /* run as the memory based filesystem */ @@ -100,7 +111,6 @@ extern int density; /* number of bytes per inode */ extern int maxcontig; /* max contiguous blocks to allocate */ extern int rotdelay; /* rotational delay between blocks */ extern int maxbpg; /* maximum blocks per file in a cyl group */ -extern int nrpos; /* # of distinguished rotational positions */ extern int bbsize; /* boot block size */ extern int sbsize; /* superblock size */ extern int avgfilesize; /* expected average file size */ @@ -163,7 +173,7 @@ mkfs(struct partition *pp, char *fsys, int fi, int fo, mode_t mfsmode, uid_t mfsuid, gid_t mfsgid) { long i, mincpc, mincpg, inospercg; - long cylno, rpos, blk, j, warn = 0; + long cylno, j, warn = 0; long used, mincpgcnt, bpcg; long mapcramped, inodecramped; long postblsize, rotblsize, totalsbsize; @@ -276,7 +286,7 @@ recalc: sblock.fs_fsize, sblock.fs_bsize, sblock.fs_bsize / MAXFRAG); } - sblock.fs_nrpos = nrpos; + sblock.fs_nrpos = NRPOS; sblock.fs_nindir = sblock.fs_bsize / sizeof(daddr_t); sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs1_dinode); sblock.fs_nspf = sblock.fs_fsize / sectorsize; @@ -509,19 +519,11 @@ recalc: postblsize = sblock.fs_nrpos * sblock.fs_cpc * sizeof(int16_t); rotblsize = sblock.fs_cpc * sblock.fs_spc / NSPB(&sblock); totalsbsize = sizeof(struct fs) + rotblsize; - if (sblock.fs_nrpos == 8 && sblock.fs_cpc <= 16) { - /* use old static table space */ - sblock.fs_postbloff = (char *)(&sblock.fs_opostbl[0][0]) - - (char *)(&sblock.fs_firstfield); - sblock.fs_rotbloff = &sblock.fs_space[0] - - (u_char *)(&sblock.fs_firstfield); - } else { - /* use dynamic table space */ - sblock.fs_postbloff = &sblock.fs_space[0] - - (u_char *)(&sblock.fs_firstfield); - sblock.fs_rotbloff = sblock.fs_postbloff + postblsize; - totalsbsize += postblsize; - } + /* use dynamic table space */ + sblock.fs_postbloff = &sblock.fs_space[0] - + (u_char *)(&sblock.fs_firstfield); + sblock.fs_rotbloff = sblock.fs_postbloff + postblsize; + totalsbsize += postblsize; if (totalsbsize > SBSIZE || fragroundup(&sblock, totalsbsize) > SBSIZE || sblock.fs_nsect > (1 << NBBY) * NSPB(&sblock)) { printf("%s %s %d %s %d.%s", @@ -533,24 +535,6 @@ recalc: goto next; } sblock.fs_sbsize = fragroundup(&sblock, totalsbsize); - /* - * calculate the available blocks for each rotational position - */ - for (cylno = 0; cylno < sblock.fs_cpc; cylno++) - for (rpos = 0; rpos < sblock.fs_nrpos; rpos++) - fs_postbl(&sblock, cylno)[rpos] = -1; - for (i = (rotblsize - 1) * sblock.fs_frag; - i >= 0; i -= sblock.fs_frag) { - cylno = cbtocylno(&sblock, i); - rpos = cbtorpos(&sblock, i); - blk = fragstoblks(&sblock, i); - if (fs_postbl(&sblock, cylno)[rpos] == -1) - fs_rotbl(&sblock)[blk] = 0; - else - fs_rotbl(&sblock)[blk] = - fs_postbl(&sblock, cylno)[rpos] - blk; - fs_postbl(&sblock, cylno)[rpos] = blk; - } next: /* * Compute/validate number of cylinder groups. diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8 index 0ed183bbcd5..ff7019ac9b9 100644 --- a/sbin/newfs/newfs.8 +++ b/sbin/newfs/newfs.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: newfs.8,v 1.45 2005/06/27 10:07:15 jmc Exp $ +.\" $OpenBSD: newfs.8,v 1.46 2006/03/09 13:35:02 pedro Exp $ .\" $NetBSD: newfs.8,v 1.12 1995/03/18 14:58:41 cgd Exp $ .\" .\" Copyright (c) 1983, 1987, 1991, 1993, 1994 @@ -192,9 +192,6 @@ for more details on how to set this option. .It Fl N Causes the file system parameters to be printed out without really creating the file system. -.It Fl n Ar nrpos -The number of distinct rotational positions. -The default is 1. .It Fl O Creates a .Bx 4.3 diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index bf9643cfa9f..989439c7a48 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: newfs.c,v 1.51 2005/10/28 19:10:57 otto Exp $ */ +/* $OpenBSD: newfs.c,v 1.52 2006/03/09 13:35:02 pedro Exp $ */ /* $NetBSD: newfs.c,v 1.20 1996/05/16 07:13:03 thorpej Exp $ */ /* @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)newfs.c 8.8 (Berkeley) 4/18/94"; #else -static char rcsid[] = "$OpenBSD: newfs.c,v 1.51 2005/10/28 19:10:57 otto Exp $"; +static char rcsid[] = "$OpenBSD: newfs.c,v 1.52 2006/03/09 13:35:02 pedro Exp $"; #endif #endif /* not lint */ @@ -132,18 +132,6 @@ u_short dkcksum(struct disklabel *); */ #define NFPI 4 -/* - * For each cylinder we keep track of the availability of blocks at different - * rotational positions, so that we can lay out the data to be picked - * up with minimum rotational latency. NRPOS is the default number of - * rotational positions that we distinguish. With NRPOS of 8 the resolution - * of our summary information is 2ms for a typical 3600 rpm drive. Caching - * and zoning pretty much defeats rotational optimization, so we now use a - * default of 1. - */ -#define NRPOS 1 /* number distinct rotational positions */ - - int mfs; /* run as the memory based filesystem */ int Nflag; /* run without writing file system */ int Oflag; /* format as an 4.3BSD file system */ @@ -170,7 +158,6 @@ int density; /* number of bytes per inode */ int maxcontig = 0; /* max contiguous blocks to allocate */ int rotdelay = ROTDELAY; /* rotational delay between blocks */ int maxbpg; /* maximum blocks per file in a cyl group */ -int nrpos = NRPOS; /* # of distinguished rotational positions */ int avgfilesize = AVFILESIZ;/* expected average file size */ int avgfilesperdir = AFPDIR;/* expected number of files per directory */ int bbsize = BBSIZE; /* boot block size */ @@ -233,7 +220,7 @@ main(int argc, char *argv[]) opstring = mfs ? "P:T:a:b:c:d:e:f:i:m:o:s:" : - "NOS:T:a:b:c:d:e:f:g:h:i:k:l:m:n:o:p:qr:s:t:u:x:z:"; + "NOS:T:a:b:c:d:e:f:g:h:i:k:l:m:o:p:qr:s:t:u:x:z:"; while ((ch = getopt(argc, argv, opstring)) != -1) { switch (ch) { case 'N': @@ -302,11 +289,6 @@ main(int argc, char *argv[]) if ((minfree = atoi(optarg)) < 0 || minfree > 99) fatal("%s: bad free space %%\n", optarg); break; - case 'n': - if ((nrpos = atoi(optarg)) <= 0) - fatal("%s: bad rotational layout count\n", - optarg); - break; case 'o': if (mfs) getmntopts(optarg, mopts, &mntflags); |