summaryrefslogtreecommitdiffstats
path: root/sbin/newfs/newfs.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2001-04-02 01:25:55 +0000
committerobrien <obrien@FreeBSD.org>2001-04-02 01:25:55 +0000
commitd74457c7fee6b3e0c28e125587ce31c9c85fdb06 (patch)
treeab28c07b151043b1a77da918c0fbe51aeb91a01c /sbin/newfs/newfs.c
parent3100bf9079fdce415a0e7394dfaeb5914b09c958 (diff)
downloadFreeBSD-src-d74457c7fee6b3e0c28e125587ce31c9c85fdb06.zip
FreeBSD-src-d74457c7fee6b3e0c28e125587ce31c9c85fdb06.tar.gz
Allow enabling soft updates (with -U) on a new filesystem.
[I first added this functionality, and thought to check prior art. Seeing OpenBSD had already done this, I changed my addition to reduce the diffs between the two and went with their option letter.] Obtained from: OpenBSD
Diffstat (limited to 'sbin/newfs/newfs.c')
-rw-r--r--sbin/newfs/newfs.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c
index b006a8a..e755993 100644
--- a/sbin/newfs/newfs.c
+++ b/sbin/newfs/newfs.c
@@ -173,6 +173,7 @@ char *mfs_mtpt; /* mount point for mfs */
struct stat mfs_mtstat; /* stat prior to mount */
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 = NTRACKS; /* # tracks/cylinder */
int nsectors = NSECTORS; /* # sectors/track */
@@ -255,8 +256,8 @@ main(argc, argv)
}
opstring = mfs ?
- "NF:T: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:r:s:t:u:vx:";
+ "NF:T:Ua:b:c:d:e:f:i:m:o:s:" :
+ "NOS:T:Ua:b:c:d:e:f:i:k:l:m:n:o:p:r:s:t:u:vx:";
while ((ch = getopt(argc, argv, opstring)) != -1)
switch (ch) {
case 'N':
@@ -277,6 +278,9 @@ main(argc, argv)
case 'F':
filename = optarg;
break;
+ case 'U':
+ Uflag = 1;
+ break;
case 'a':
if ((maxcontig = atoi(optarg)) <= 0)
fatal("%s: bad maximum contiguous blocks",
@@ -757,6 +761,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");
OpenPOWER on IntegriCloud