summaryrefslogtreecommitdiff
path: root/sbin/newfs
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>1999-12-03 19:24:19 +0000
committerArtur Grabowski <art@cvs.openbsd.org>1999-12-03 19:24:19 +0000
commitf8629da36fa63327430387dbbf03650fc3a9c3ec (patch)
tree23c5ef37e5a0c66d01f571e5107f19c75f8a562e /sbin/newfs
parent55e1b19e7ff69e38ed81225257c490d6bcbb56cf (diff)
Allow enabling soft updates (with -U) on a new filesystem.
Allow soft updates on mfs filesystems (even if it's stupid).
Diffstat (limited to 'sbin/newfs')
-rw-r--r--sbin/newfs/mkfs.c8
-rw-r--r--sbin/newfs/newfs.88
-rw-r--r--sbin/newfs/newfs.c13
3 files changed, 20 insertions, 9 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c
index d48df04b277..619289a70e6 100644
--- a/sbin/newfs/mkfs.c
+++ b/sbin/newfs/mkfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkfs.c,v 1.12 1999/04/10 04:09:23 millert Exp $ */
+/* $OpenBSD: mkfs.c,v 1.13 1999/12/03 19:24:17 art Exp $ */
/* $NetBSD: mkfs.c,v 1.25 1995/06/18 21:35:38 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)mkfs.c 8.3 (Berkeley) 2/3/94";
#else
-static char rcsid[] = "$OpenBSD: mkfs.c,v 1.12 1999/04/10 04:09:23 millert Exp $";
+static char rcsid[] = "$OpenBSD: mkfs.c,v 1.13 1999/12/03 19:24:17 art Exp $";
#endif
#endif /* not lint */
@@ -83,6 +83,7 @@ static char rcsid[] = "$OpenBSD: mkfs.c,v 1.12 1999/04/10 04:09:23 millert Exp $
extern int mfs; /* run as the memory based filesystem */
extern int Nflag; /* run mkfs without writing file system */
extern int Oflag; /* format as an 4.3BSD file system */
+extern int Uflag; /* enable soft updates for file system */
extern int fssize; /* file system size */
extern int ntracks; /* # tracks/cylinder */
extern int nsectors; /* # sectors/track */
@@ -188,6 +189,9 @@ mkfs(pp, fsys, fi, fo)
sblock.fs_inodefmt = FS_44INODEFMT;
sblock.fs_maxsymlinklen = MAXSYMLINKLEN;
}
+ if (Uflag) {
+ sblock.fs_flags |= FS_DOSOFTDEP;
+ }
/*
* Validate the given file system size.
* Verify that its last block can actually be accessed.
diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8
index da398409eea..e66c3c9ed9f 100644
--- a/sbin/newfs/newfs.8
+++ b/sbin/newfs/newfs.8
@@ -1,4 +1,4 @@
-.\" $OpenBSD: newfs.8,v 1.18 1999/09/29 13:50:44 aaron Exp $
+.\" $OpenBSD: newfs.8,v 1.19 1999/12/03 19:24:18 art Exp $
.\" $NetBSD: newfs.8,v 1.12 1995/03/18 14:58:41 cgd Exp $
.\"
.\" Copyright (c) 1983, 1987, 1991, 1993, 1994
@@ -42,7 +42,7 @@
.Nd construct a new file system
.Sh SYNOPSIS
.Nm newfs
-.Op Fl NO
+.Op Fl NOU
.Op Fl S Ar sector-size
.Op Fl a Ar maxcontig
.Op Fl b Ar block-size
@@ -67,7 +67,7 @@
.Ar special
.Pp
.Nm mount_mfs
-.Op Fl N
+.Op Fl NU
.Op Fl a Ar maxcontig
.Op Fl b Ar block-size
.Op Fl c Ar cylinders
@@ -149,6 +149,8 @@ Creates a
format filesystem.
This options is primarily used to build root filesystems
that can be understood by older boot ROMs.
+.It Fl U
+Enables soft updates on the new filesystem.
.It Fl q
Operate in quiet mode. With this option,
.Nm
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c
index ba716a6c4b4..f06aa78b383 100644
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: newfs.c,v 1.19 1999/08/17 09:13:14 millert Exp $ */
+/* $OpenBSD: newfs.c,v 1.20 1999/12/03 19:24:18 art Exp $ */
/* $NetBSD: newfs.c,v 1.20 1996/05/16 07:13:03 thorpej Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)newfs.c 8.8 (Berkeley) 4/18/94";
#else
-static char rcsid[] = "$OpenBSD: newfs.c,v 1.19 1999/08/17 09:13:14 millert Exp $";
+static char rcsid[] = "$OpenBSD: newfs.c,v 1.20 1999/12/03 19:24:18 art Exp $";
#endif
#endif /* not lint */
@@ -151,6 +151,7 @@ void fatal();
int mfs; /* run as the memory based filesystem */
int Nflag; /* run without writing file system */
int Oflag; /* format as an 4.3BSD file system */
+int Uflag; /* enable soft updates for file system */
int fssize; /* file system size */
int ntracks; /* # tracks/cylinder */
int nsectors; /* # sectors/track */
@@ -217,8 +218,8 @@ main(argc, argv)
fatal("insane maxpartitions value %d", maxpartitions);
opstring = mfs ?
- "NT:a:b:c:d:e:f:i:m:o:s:" :
- "NOS:T:a:b:c:d:e:f:i:k:l:m:n:o:p:qr:s:t:u:x:z:";
+ "NT:Ua:b:c:d:e:f:i:m:o:s:" :
+ "NOS:UT:a:b:c:d:e:f:i:k:l:m:n:o:p:qr:s:t:u:x:z:";
while ((ch = getopt(argc, argv, opstring)) != -1) {
switch (ch) {
case 'N':
@@ -236,6 +237,9 @@ main(argc, argv)
disktype = optarg;
break;
#endif
+ case 'U':
+ Uflag = 1;
+ break;
case 'a':
if ((maxcontig = atoi(optarg)) <= 0)
fatal("%s: bad maximum contiguous blocks\n",
@@ -727,6 +731,7 @@ usage()
#ifdef COMPAT
fprintf(stderr, "\t-T disktype\n");
#endif
+ fprintf(stderr, "\t-U enable soft updates\n");
fprintf(stderr, "\t-a maximum contiguous blocks\n");
fprintf(stderr, "\t-b block size\n");
fprintf(stderr, "\t-c cylinders/group\n");