diff options
author | Poul-Henning Kamp <phk@FreeBSD.org> | 2002-04-03 20:48:05 +0000 |
---|---|---|
committer | Poul-Henning Kamp <phk@FreeBSD.org> | 2002-04-03 20:48:05 +0000 |
commit | 1f35193bdc8ff35a09483b8d6745848ddce830af (patch) | |
tree | 695b9691b79f3a979251533e2be47f7ebe79fc74 | |
parent | a463023d6d11f3fa38d614dd16a23c3ee94217f7 (diff) | |
download | src-1f35193bdc8ff35a09483b8d6745848ddce830af.tar.gz src-1f35193bdc8ff35a09483b8d6745848ddce830af.zip |
Notes
-rw-r--r-- | sbin/newfs/mkfs.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index eefec83253e0..4708842ae7af 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -178,20 +178,24 @@ mkfs(struct partition *pp, char *fsys, int fi, int fo) exit(17); } if (sblock.fs_fsize < sectorsize) { - printf("fragment size %d is too small, minimum is %d\n", + printf("increasing fragment size from %d to sectorsize (%d)\n", sblock.fs_fsize, sectorsize); - exit(18); + sblock.fs_fsize = sectorsize; } if (sblock.fs_bsize < MINBSIZE) { - printf("block size %d is too small, minimum is %d\n", + printf("increasing block size from %d to minimum (%d)\n", sblock.fs_bsize, MINBSIZE); - exit(19); + sblock.fs_bsize = MINBSIZE; } if (sblock.fs_bsize < sblock.fs_fsize) { - printf( - "block size (%d) cannot be smaller than fragment size (%d)\n", + printf("increasing block size from %d to fragsize (%d)\n", sblock.fs_bsize, sblock.fs_fsize); - exit(20); + sblock.fs_bsize = sblock.fs_fsize; + } + if (sblock.fs_fsize * MAXFRAG < sblock.fs_bsize) { + printf("increasing fragsize from %d to block size / %d (%d)\n", + sblock.fs_fsize, MAXFRAG, sblock.fs_bsize / MAXFRAG); + sblock.fs_fsize = sblock.fs_bsize / MAXFRAG; } sblock.fs_bmask = ~(sblock.fs_bsize - 1); sblock.fs_fmask = ~(sblock.fs_fsize - 1); @@ -202,9 +206,7 @@ mkfs(struct partition *pp, char *fsys, int fi, int fo) sblock.fs_frag = numfrags(&sblock, sblock.fs_bsize); sblock.fs_fragshift = ilog2(sblock.fs_frag); if (sblock.fs_frag > MAXFRAG) { - printf( - "fragment size %d is too small, minimum with block size %d is %d\n", - sblock.fs_fsize, sblock.fs_bsize, + printf( "SYSERR: fragsize too small %d (block/frag ratio)\n", sblock.fs_bsize / MAXFRAG); exit(21); } @@ -975,7 +977,7 @@ static char wc[WCSIZE]; /* bytes */ /* * Flush dirty write behind buffer. */ -void +static void wtfsflush() { int n; @@ -996,7 +998,7 @@ wtfsflush() /* * write a block to the file system */ -void +static void wtfs(daddr_t bno, int size, char *bf) { int done, n; @@ -1037,7 +1039,7 @@ wtfs(daddr_t bno, int size, char *bf) /* * check if a block is available */ -int +static int isblock(struct fs *fs, unsigned char *cp, int h) { unsigned char mask; @@ -1063,7 +1065,7 @@ isblock(struct fs *fs, unsigned char *cp, int h) /* * take a block out of the map */ -void +static void clrblock(struct fs *fs, unsigned char *cp, int h) { switch ((fs)->fs_frag) { @@ -1088,7 +1090,7 @@ clrblock(struct fs *fs, unsigned char *cp, int h) /* * put a block into the map */ -void +static void setblock(struct fs *fs, unsigned char *cp, int h) { switch (fs->fs_frag) { |