Following the discussion in -arch and the submission of a patch by bde, here

it is. I added the manpage change.

Submitted by:	bde
MFC after:	1 week
This commit is contained in:
Ollivier Robert 2001-10-04 12:15:50 +00:00
parent 3d8712c3a1
commit 08870345f5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=84466
2 changed files with 20 additions and 11 deletions

View File

@ -112,12 +112,10 @@ for more details on how to set this option.
The block size of the file system, in bytes. It must be a power of 2. The
default size is 8192 bytes, and the smallest allowable size is 4096 bytes.
.It Fl c Ar #cylinders/group
The number of cylinders per cylinder group in a file system. The default value
is 22. The maximum value is dependent on a number of other parameters, in
particular the block size. The best way to find the maximum value for a
specific file system is to attempt to specify a value which is far too large:
.Nm
will print out the maximum value.
The number of cylinders per cylinder group in a file system. The default
is to compute the maximum allowed by the other parameters. This value is
dependent on a number of other parameters, in particular the block size
and the number of bytes per inode.
.It Fl d Ar rotdelay
This parameter once specified the minimum time in milliseconds required to
initiate another disk transfer on the same cylinder. It was used in determining

View File

@ -104,11 +104,10 @@ void fatal();
/*
* Cylinder groups may have up to many cylinders. The actual
* number used depends upon how much information can be stored
* on a single cylinder. The default is to use 22 cylinders
* per group, which seems to be the largest value allowed given
* all the other default values.
* on a single cylinder. The default is to use as many as possible
* cylinders per group.
*/
#define DESCPG 22 /* desired fs_cpg */
#define DESCPG 65536 /* desired fs_cpg ("infinity") */
/*
* Once upon a time...
@ -167,6 +166,7 @@ int Uflag; /* enable soft updates for file system */
int fssize; /* file system size */
int ntracks = NTRACKS; /* # tracks/cylinder */
int nsectors = NSECTORS; /* # sectors/track */
int ncyls; /* # complete cylinders */
int nphyssectors; /* # sectors/track including spares */
int secpercyl; /* sectors per cylinder */
int trackspares = -1; /* spare sectors per track */
@ -180,7 +180,7 @@ int headswitch; /* head switch time, usec */
int trackseek; /* track-to-track seek, usec */
int fsize = 0; /* fragment size */
int bsize = 0; /* block size */
int cpg = DESCPG; /* cylinders/cylinder group */
int cpg = 0; /* cylinders/cylinder group */
int cpgflg; /* cylinders/cylinder group flag was given */
int minfree = MINFREE; /* free space threshold */
int opt = DEFAULTOPT; /* optimization preference (space or time) */
@ -545,6 +545,17 @@ main(argc, argv)
pp->p_size *= secperblk;
}
#endif
ncyls = fssize / secpercyl;
if (ncyls == 0)
ncyls = 1; /* XXX */
if (cpg == 0)
cpg = DESCPG < ncyls ? DESCPG : ncyls;
else if (cpg > ncyls) {
cpg = ncyls;
printf(
"Number of cylinders restricts cylinders per group to %d.\n",
cpg);
}
mkfs(pp, special, fsi, fso);
#ifdef tahoe
if (realsectorsize != DEV_BSIZE)