Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src some improvements from freebsd/openbsd
details: https://anonhg.NetBSD.org/src/rev/90544d545d2d
branches: trunk
changeset: 514346:90544d545d2d
user: lukem <lukem%NetBSD.org@localhost>
date: Thu Aug 30 14:37:25 2001 +0000
description:
some improvements from freebsd/openbsd
- replace the unused fs_headswitch and fs_trkseek with fs_id[2], bringing
our struct fs closer to that in freebsd & openbsd (& solaris FWIW)
- dumpfs: improve warning message when cpc == 0
diffstat:
sbin/newfs/extern.h | 4 +---
sbin/newfs/mkfs.c | 6 ++----
sbin/newfs/newfs.c | 8 ++------
sys/ufs/ffs/fs.h | 6 +++---
usr.sbin/dumpfs/dumpfs.c | 14 ++++++--------
5 files changed, 14 insertions(+), 24 deletions(-)
diffs (165 lines):
diff -r 0f44876ad284 -r 90544d545d2d sbin/newfs/extern.h
--- a/sbin/newfs/extern.h Thu Aug 30 12:26:06 2001 +0000
+++ b/sbin/newfs/extern.h Thu Aug 30 14:37:25 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.4 2001/07/30 07:45:08 lukem Exp $ */
+/* $NetBSD: extern.h,v 1.5 2001/08/30 14:37:26 lukem Exp $ */
/*
* Copyright (c) 1997 Christos Zoulas. All rights reserved.
@@ -45,8 +45,6 @@
extern int rpm; /* revolutions/minute of drive */
extern int interleave; /* hardware sector interleave */
extern int trackskew; /* sector 0 skew, per track */
-extern int headswitch; /* head switch time, usec */
-extern int trackseek; /* track-to-track seek, usec */
extern int fsize; /* fragment size */
extern int bsize; /* block size */
extern int cpg; /* cylinders/cylinder group */
diff -r 0f44876ad284 -r 90544d545d2d sbin/newfs/mkfs.c
--- a/sbin/newfs/mkfs.c Thu Aug 30 12:26:06 2001 +0000
+++ b/sbin/newfs/mkfs.c Thu Aug 30 14:37:25 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mkfs.c,v 1.52 2001/08/25 01:42:46 lukem Exp $ */
+/* $NetBSD: mkfs.c,v 1.53 2001/08/30 14:37:26 lukem Exp $ */
/*
* Copyright (c) 1980, 1989, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)mkfs.c 8.11 (Berkeley) 5/3/95";
#else
-__RCSID("$NetBSD: mkfs.c,v 1.52 2001/08/25 01:42:46 lukem Exp $");
+__RCSID("$NetBSD: mkfs.c,v 1.53 2001/08/30 14:37:26 lukem Exp $");
#endif
#endif /* not lint */
@@ -542,8 +542,6 @@
sblock.fs_rotdelay = rotdelay;
sblock.fs_minfree = minfree;
sblock.fs_maxcontig = maxcontig;
- sblock.fs_headswitch = headswitch;
- sblock.fs_trkseek = trackseek;
sblock.fs_maxbpg = maxbpg;
sblock.fs_rps = rpm / 60;
sblock.fs_optim = opt;
diff -r 0f44876ad284 -r 90544d545d2d sbin/newfs/newfs.c
--- a/sbin/newfs/newfs.c Thu Aug 30 12:26:06 2001 +0000
+++ b/sbin/newfs/newfs.c Thu Aug 30 14:37:25 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: newfs.c,v 1.45 2001/08/08 07:34:53 lukem Exp $ */
+/* $NetBSD: newfs.c,v 1.46 2001/08/30 14:37:26 lukem Exp $ */
/*
* Copyright (c) 1983, 1989, 1993, 1994
@@ -43,7 +43,7 @@
#if 0
static char sccsid[] = "@(#)newfs.c 8.13 (Berkeley) 5/1/95";
#else
-__RCSID("$NetBSD: newfs.c,v 1.45 2001/08/08 07:34:53 lukem Exp $");
+__RCSID("$NetBSD: newfs.c,v 1.46 2001/08/30 14:37:26 lukem Exp $");
#endif
#endif /* not lint */
@@ -168,8 +168,6 @@
int rpm; /* revolutions/minute of drive */
int interleave; /* hardware sector interleave */
int trackskew = -1; /* sector 0 skew, per track */
-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 */
@@ -622,8 +620,6 @@
"disagrees with disk label", lp->d_secpercyl);
if (maxbpg == 0)
maxbpg = MAXBLKPG(bsize);
- headswitch = lp->d_headswitch;
- trackseek = lp->d_trkseek;
#ifdef notdef /* label may be 0 if faked up by kernel */
bbsize = lp->d_bbsize;
sbsize = lp->d_sbsize;
diff -r 0f44876ad284 -r 90544d545d2d sys/ufs/ffs/fs.h
--- a/sys/ufs/ffs/fs.h Thu Aug 30 12:26:06 2001 +0000
+++ b/sys/ufs/ffs/fs.h Thu Aug 30 14:37:25 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fs.h,v 1.15 2001/08/30 08:31:25 lukem Exp $ */
+/* $NetBSD: fs.h,v 1.16 2001/08/30 14:37:25 lukem Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -203,8 +203,8 @@
int32_t fs_npsect; /* # sectors/track including spares */
int32_t fs_interleave; /* hardware sector interleave */
int32_t fs_trackskew; /* sector 0 skew, per track */
- int32_t fs_headswitch; /* head switch time, usec (UNUSED) */
- int32_t fs_trkseek; /* track-to-track seek, usec (UNUSED) */
+/* fs_id takes the space of the unused fs_headswitch and fs_trkseek fields */
+ int32_t fs_id[2]; /* unique file system id */
/* sizes determined by number of cylinder groups and their sizes */
ufs_daddr_t fs_csaddr; /* blk addr of cyl grp summary area */
int32_t fs_cssize; /* size of cyl grp summary area */
diff -r 0f44876ad284 -r 90544d545d2d usr.sbin/dumpfs/dumpfs.c
--- a/usr.sbin/dumpfs/dumpfs.c Thu Aug 30 12:26:06 2001 +0000
+++ b/usr.sbin/dumpfs/dumpfs.c Thu Aug 30 14:37:25 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dumpfs.c,v 1.27 2001/08/17 02:18:49 lukem Exp $ */
+/* $NetBSD: dumpfs.c,v 1.28 2001/08/30 14:37:27 lukem Exp $ */
/*
* Copyright (c) 1983, 1992, 1993
@@ -43,25 +43,22 @@
#if 0
static char sccsid[] = "@(#)dumpfs.c 8.5 (Berkeley) 4/29/95";
#else
-__RCSID("$NetBSD: dumpfs.c,v 1.27 2001/08/17 02:18:49 lukem Exp $");
+__RCSID("$NetBSD: dumpfs.c,v 1.28 2001/08/30 14:37:27 lukem Exp $");
#endif
#endif /* not lint */
#include <sys/param.h>
#include <sys/time.h>
-#include <ufs/ufs/dinode.h>
#include <ufs/ufs/ufs_bswap.h>
#include <ufs/ffs/fs.h>
#include <ufs/ffs/ffs_extern.h>
#include <err.h>
-#include <errno.h>
#include <fcntl.h>
#include <fstab.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
union {
@@ -169,6 +166,7 @@
i++;
}
}
+ printf("id\t[ %x %x ]\n", afs.fs_id[0], afs.fs_id[1]);
printf("cylgrp\t%s\tinodes\t%s\tfslevel %d\tsoftdep %sabled\n",
i < 1 ? "static" : "dynamic", i < 2 ? "4.2/4.3BSD" : "4.4BSD", i,
(afs.fs_flags & FS_DOSOFTDEP) ? "en" : "dis");
@@ -188,8 +186,8 @@
printf("minfree\t%d%%\toptim\t%s\tmaxcontig %d\tmaxbpg\t%d\n",
afs.fs_minfree, afs.fs_optim == FS_OPTSPACE ? "space" : "time",
afs.fs_maxcontig, afs.fs_maxbpg);
- printf("rotdelay %dms\theadswitch %dus\ttrackseek %dus\trps\t%d\n",
- afs.fs_rotdelay, afs.fs_headswitch, afs.fs_trkseek, afs.fs_rps);
+ printf("rotdelay %dms\trps\t%d\n",
+ afs.fs_rotdelay, afs.fs_rps);
printf("ntrak\t%d\tnsect\t%d\tnpsect\t%d\tspc\t%d\n",
afs.fs_ntrak, afs.fs_nsect, afs.fs_npsect, afs.fs_spc);
printf("symlinklen %d\ttrackskew %d\tinterleave %d\tcontigsumsize %d\n",
@@ -211,7 +209,7 @@
printf("blocks available in each of %d rotational positions",
afs.fs_nrpos);
else
- printf("insufficient space to maintain rotational tables\n");
+ printf("(no rotational position table)\n");
for (c = 0; c < afs.fs_cpc; c++) {
printf("\ncylinder number %d:", c);
for (i = 0; i < afs.fs_nrpos; i++) {
Home |
Main Index |
Thread Index |
Old Index