diff options
author | pjd <pjd@FreeBSD.org> | 2006-10-31 21:52:28 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2006-10-31 21:52:28 +0000 |
commit | ad87251c1a1185717a0f74277ecd4a6def65e583 (patch) | |
tree | b48f4736ca193851013f4dcfe8f64cc8cedffd00 /sbin/newfs | |
parent | 036e929548382eba04c176d581bb24928a5d4155 (diff) | |
download | FreeBSD-src-ad87251c1a1185717a0f74277ecd4a6def65e583.zip FreeBSD-src-ad87251c1a1185717a0f74277ecd4a6def65e583.tar.gz |
Add -J flag to both newfs(8) and tunefs(8) which allows to enable gjournal
support.
I left -j flag for UFS journal implementation which we may gain at some
point.
Sponsored by: home.pl
Diffstat (limited to 'sbin/newfs')
-rw-r--r-- | sbin/newfs/mkfs.c | 2 | ||||
-rw-r--r-- | sbin/newfs/newfs.8 | 4 | ||||
-rw-r--r-- | sbin/newfs/newfs.c | 6 | ||||
-rw-r--r-- | sbin/newfs/newfs.h | 1 |
4 files changed, 11 insertions, 2 deletions
diff --git a/sbin/newfs/mkfs.c b/sbin/newfs/mkfs.c index 916b34c..fe862b5 100644 --- a/sbin/newfs/mkfs.c +++ b/sbin/newfs/mkfs.c @@ -135,6 +135,8 @@ mkfs(struct partition *pp, char *fsys) sblock.fs_flags |= FS_DOSOFTDEP; if (Lflag) strlcpy(sblock.fs_volname, volumelabel, MAXVOLLEN); + if (Jflag) + sblock.fs_flags |= FS_GJOURNAL; if (lflag) sblock.fs_flags |= FS_MULTILABEL; /* diff --git a/sbin/newfs/newfs.8 b/sbin/newfs/newfs.8 index f907642..8be6d35 100644 --- a/sbin/newfs/newfs.8 +++ b/sbin/newfs/newfs.8 @@ -36,7 +36,7 @@ .Nd construct a new UFS1/UFS2 file system .Sh SYNOPSIS .Nm -.Op Fl NUln +.Op Fl JNUln .Op Fl L Ar volname .Op Fl O Ar filesystem-type .Op Fl S Ar sector-size @@ -77,6 +77,8 @@ has numerous options to allow the defaults to be selectively overridden. .Pp The following options define the general layout policies: .Bl -tag -width indent +.It Fl J +Enable journaling on the new file system via gjournal. .It Fl L Ar volname Add a volume label to the new file system. .It Fl N diff --git a/sbin/newfs/newfs.c b/sbin/newfs/newfs.c index 289d055..85fb34b 100644 --- a/sbin/newfs/newfs.c +++ b/sbin/newfs/newfs.c @@ -117,6 +117,7 @@ int Oflag = 2; /* file system format (1 => UFS1, 2 => UFS2) */ int Rflag; /* regression test */ int Uflag; /* enable soft updates for file system */ int Eflag = 0; /* exit in middle of newfs for testing */ +int Jflag; /* enable gjournal for file system */ int lflag; /* enable multilabel for file system */ int nflag; /* do not create .snap directory */ quad_t fssize; /* file system size */ @@ -156,11 +157,14 @@ main(int argc, char *argv[]) off_t mediasize; while ((ch = getopt(argc, argv, - "EL:NO:RS:T:Ua:b:c:d:e:f:g:h:i:lm:no:s:")) != -1) + "EJL:NO:RS:T:Ua:b:c:d:e:f:g:h:i:lm:no:s:")) != -1) switch (ch) { case 'E': Eflag++; break; + case 'J': + Jflag = 1; + break; case 'L': volumelabel = optarg; i = -1; diff --git a/sbin/newfs/newfs.h b/sbin/newfs/newfs.h index dae9fd8..55f920f 100644 --- a/sbin/newfs/newfs.h +++ b/sbin/newfs/newfs.h @@ -49,6 +49,7 @@ extern int Oflag; /* build UFS1 format file system */ extern int Rflag; /* regression test */ extern int Uflag; /* enable soft updates for file system */ extern int Eflag; /* exit as if error, for testing */ +extern int Jflag; /* enable gjournal for file system */ extern int lflag; /* enable multilabel MAC for file system */ extern int nflag; /* do not create .snap directory */ extern quad_t fssize; /* file system size */ |