Skip to content
Browse files

Default to creating a v2 lfs, and print out the roll-forward id that

was used.  Update newfs_lfs.8 to reflect new options.
  • Loading branch information...
1 parent aa4d5c5 commit 37081a1a8f5fc942c38aa5e20a2550c1ae28e25d perseant committed
Showing with 31 additions and 29 deletions.
  1. +6 −1 sbin/newfs_lfs/config.h
  2. +6 −3 sbin/newfs_lfs/lfs.c
  3. +4 −4 sbin/newfs_lfs/newfs.c
  4. +15 −21 sbin/newfs_lfs/newfs_lfs.8
View
7 sbin/newfs_lfs/config.h
@@ -1,4 +1,4 @@
-/* $NetBSD: config.h,v 1.5.2.1 2001/06/27 03:49:41 perseant Exp $ */
+/* $NetBSD: config.h,v 1.5.2.2 2001/07/13 05:14:22 perseant Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -36,6 +36,11 @@
*/
/*
+ * Version of the LFS to make. Default to the newest one.
+ */
+#define DFL_VERSION LFS_VERSION
+
+/*
* The following two constants set the default block and fragment sizes.
* Both constants must be a power of 2 and meet the following constraints:
* MINBSIZE <= DESBLKSIZE <= MAXBSIZE
View
9 sbin/newfs_lfs/lfs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs.c,v 1.21.2.4 2001/07/10 01:46:11 perseant Exp $ */
+/* $NetBSD: lfs.c,v 1.21.2.5 2001/07/13 05:14:22 perseant Exp $ */
/*-
* Copyright (c) 1991, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)lfs.c 8.5 (Berkeley) 5/24/95";
#else
-__RCSID("$NetBSD: lfs.c,v 1.21.2.4 2001/07/10 01:46:11 perseant Exp $");
+__RCSID("$NetBSD: lfs.c,v 1.21.2.5 2001/07/13 05:14:22 perseant Exp $");
#endif
#endif /* not lint */
@@ -663,7 +663,10 @@ make_lfs(int fd, struct disklabel *lp, struct partition *partp, int minfree,
/* Now, write the segment */
- printf("Creating a version %d LFS\n", lfsp->lfs_version);
+ printf("Creating a version %d LFS", lfsp->lfs_version);
+ if (lfsp->lfs_version > 1)
+ printf(" with roll-forward ident 0x%x", lfsp->lfs_ident);
+ printf("\n");
fssize = (double)lfsp->lfs_nseg;
fssize *= (double)ssize;
fssize /= 1048576.0;
View
8 sbin/newfs_lfs/newfs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: newfs.c,v 1.6.2.2 2001/06/29 03:56:44 perseant Exp $ */
+/* $NetBSD: newfs.c,v 1.6.2.3 2001/07/13 05:14:23 perseant Exp $ */
/*-
* Copyright (c) 1989, 1992, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1992, 1993\n\
#if 0
static char sccsid[] = "@(#)newfs.c 8.5 (Berkeley) 5/24/95";
#else
-__RCSID("$NetBSD: newfs.c,v 1.6.2.2 2001/06/29 03:56:44 perseant Exp $");
+__RCSID("$NetBSD: newfs.c,v 1.6.2.3 2001/07/13 05:14:23 perseant Exp $");
#endif
#endif /* not lint */
@@ -78,7 +78,7 @@ __RCSID("$NetBSD: newfs.c,v 1.6.2.2 2001/06/29 03:56:44 perseant Exp $");
#define COMPAT /* allow non-labeled disks */
-int version = 1; /* what version of lfs to make */
+int version = DFL_VERSION; /* what version of lfs to make */
int Nflag = 0; /* run without writing file system */
int fssize; /* file system size */
int sectorsize; /* bytes/sector */
@@ -179,7 +179,7 @@ main(int argc, char **argv)
if (maxpartitions > 26)
fatal("insane maxpartitions value %d", maxpartitions);
- opstring = "AB:DFI:LNb:f:M:O:i:m:r:s:v:";
+ opstring = "AB:b:DFf:I:i:LM:m:NO:r:s:v:";
debug = force = segsize = start = 0;
while ((ch = getopt(argc, argv, opstring)) != -1)
View
36 sbin/newfs_lfs/newfs_lfs.8
@@ -1,4 +1,4 @@
-.\" $NetBSD: newfs_lfs.8,v 1.12.2.1 2001/06/27 03:49:42 perseant Exp $
+.\" $NetBSD: newfs_lfs.8,v 1.12.2.2 2001/07/13 05:14:23 perseant Exp $
.\"
.\" Copyright (c) 1993
.\" The Regents of the University of California. All rights reserved.
@@ -33,7 +33,7 @@
.\"
.\" @(#)newlfs.8 8.1 (Berkeley) 6/19/93
.\"
-.Dd July 15, 1999
+.Dd July 12, 2001
.Dt NEWFS_LFS 8
.Os
.Sh NAME
@@ -83,29 +83,33 @@ shift, unless these are overridden by command-line flags.
The fragment size of the file system in bytes. If not specified,
the fragment size is taken from the partition label, or if the partition
label indicates 0, a compile-time default of 1K is used.
+.It Fl I Ar interleave
+Specify the interleave between segments. The default is zero.
.It Fl i
-For a version 2 file system, specify the file system identifier, a 32-bit
-unsigned integer. This number
-is used to distinguish partial segments from this file system from other
-patrial segments with the same serial number from a previous filesystem,
-when rolling forward. If this flag is not given the identifier is chosen
-at random.
+The size of an inode block, in bytes. The default is to use the same
+size as a fragment, or in a v1 filesystem, the same size as a data block.
.It Fl L
Create a log-structured file system (LFS). This is the default, and this
option is provided for compatibility only.
-.It Fl m Ar free space \&%
-The percentage of space reserved from normal users; the minimum
-free space threshold. The default value used is 10%.
.It Fl M Ar nsegs
Reserve this many segments for use exclusively by the cleaner, instead
of letting
.Nm
do the computation. Do not use this option.
+.It Fl m Ar free space \&%
+The percentage of space reserved from normal users; the minimum
+free space threshold. The default value used is 10%.
.It Fl N
Do not actually create the filesystem.
.It Fl O Ar offset
Start the first segment this many sectors from the beginning of the
partition. The default is zero.
+.It Fl r Ar ident
+For a v2 filesystem, specify the roll-forward identifier for the
+filesystem. This identifier, a 32-bit numeric quantity,
+should be different from that of any LFS that may previously
+have existed on the same disk. By default the
+identifier is chosen at random.
.It Fl s Ar size
The size of the file system in sectors.
.It Fl v Ar version
@@ -139,16 +143,6 @@ are 1 (the default) or 2.
.%J "Proceedings of the Sixteenth ACM SOSP"
.%D October 1997
.Re
-.Rs
-.%A J. Matthews
-.%A D. Roselli
-.%A A. Costello
-.%A R. Wang
-.%A T. Anderson
-.%T "Improving the Performance of Log-Structured File Systems with Adaptive Methods"
-.%J "Proceedings of the Sixteenth ACM SOSP"
-.%D October 1997
-.Re
.Sh HISTORY
A \fBnewlfs\fR
command appeared in

0 comments on commit 37081a1

Please sign in to comment.
Something went wrong with that request. Please try again.