makefs: Add soft-updates option

Add the ffs option to enable soft-updates.
The option is only processed is ufs2 has been selected.

Reviewed by:	emaste, bapt (earlier version), allanjude (earlier version)
Sponsored by:	Gandi.net
Differential Revision:	https://reviews.freebsd.org/D10773
This commit is contained in:
Emmanuel Vadot 2017-05-18 14:19:06 +00:00
parent 3afe6a68e0
commit d91e611798
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=318452
4 changed files with 9 additions and 1 deletions

View File

@ -176,6 +176,8 @@ ffs_prep_opts(fsinfo_t *fsopts)
0, 0, "Optimization (time|space)" },
{ 'l', "label", ffs_opts->label, OPT_STRARRAY,
1, sizeof(ffs_opts->label), "UFS label" },
{ 's', "softupdates", &ffs_opts->softupdates, OPT_INT32,
0, 1, "enable softupdates" },
{ .name = NULL }
};
@ -190,6 +192,7 @@ ffs_prep_opts(fsinfo_t *fsopts)
ffs_opts->avgfilesize= -1;
ffs_opts->avgfpdir= -1;
ffs_opts->version = 1;
ffs_opts->softupdates = 0;
fsopts->fs_specific = ffs_opts;
fsopts->fs_options = copy_opts(ffs_options);

View File

@ -64,6 +64,7 @@ typedef struct {
int version; /* filesystem version (1 = FFS, 2 = UFS2) */
int maxbsize; /* maximum extent size */
int maxblkspercg; /* max # of blocks per cylinder group */
int softupdates; /* soft updates */
/* XXX: support `old' file systems ? */
} ffs_opt_t;

View File

@ -279,6 +279,8 @@ ffs_mkfs(const char *fsys, const fsinfo_t *fsopts, time_t tstamp)
sblock.fs_inopb = sblock.fs_bsize / sizeof(struct ufs2_dinode);
sblock.fs_maxsymlinklen = ((UFS_NDADDR + UFS_NIADDR) *
sizeof (ufs2_daddr_t));
if (ffs_opts->softupdates == 1)
sblock.fs_flags |= FS_DOSOFTDEP;
}
sblock.fs_sblkno =

View File

@ -35,7 +35,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd April 6, 2017
.Dd May 17, 2017
.Dt MAKEFS 8
.Os
.Sh NAME
@ -308,6 +308,8 @@ Maximum total number of blocks in a cylinder group.
.It Sy version
UFS version.
1 for FFS (default), 2 for UFS2.
.It Sy softupdates
0 for disable (default), 1 for enable
.El
.Ss CD9660-specific options
.Sy cd9660