Skip to content

Commit

Permalink
Default to creating a v2 lfs, and print out the roll-forward id that
Browse files Browse the repository at this point in the history
was used.  Update newfs_lfs.8 to reflect new options.
  • Loading branch information
perseant committed Jul 13, 2001
1 parent 7ed0ec3 commit 32bedfa
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 29 deletions.
7 changes: 6 additions & 1 deletion 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
Expand Down Expand Up @@ -35,6 +35,11 @@
* @(#)config.h 8.3 (Berkeley) 5/24/95
*/

/*
* 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:
Expand Down
9 changes: 6 additions & 3 deletions 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
Expand Down Expand Up @@ -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 */

Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions 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
Expand Down Expand Up @@ -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 */

Expand Down Expand Up @@ -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 */
Expand Down Expand Up @@ -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)
Expand Down
36 changes: 15 additions & 21 deletions 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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 32bedfa

Please sign in to comment.