diff --git a/usr.sbin/makefs/ffs.c b/usr.sbin/makefs/ffs.c index a6957edf5eff..d775df9759a1 100644 --- a/usr.sbin/makefs/ffs.c +++ b/usr.sbin/makefs/ffs.c @@ -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); diff --git a/usr.sbin/makefs/ffs.h b/usr.sbin/makefs/ffs.h index 2c1c5bbf2ff3..a3583b139e31 100644 --- a/usr.sbin/makefs/ffs.h +++ b/usr.sbin/makefs/ffs.h @@ -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; diff --git a/usr.sbin/makefs/ffs/mkfs.c b/usr.sbin/makefs/ffs/mkfs.c index 931007fb4f06..bf70f3d09a04 100644 --- a/usr.sbin/makefs/ffs/mkfs.c +++ b/usr.sbin/makefs/ffs/mkfs.c @@ -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 = diff --git a/usr.sbin/makefs/makefs.8 b/usr.sbin/makefs/makefs.8 index 7a8e67e465d7..5ad56ab35d84 100644 --- a/usr.sbin/makefs/makefs.8 +++ b/usr.sbin/makefs/makefs.8 @@ -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