summaryrefslogtreecommitdiff
path: root/sbin/tunefs/tunefs.c
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>1997-11-06 20:27:17 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>1997-11-06 20:27:17 +0000
commit05f603a9852e8da55679ee57cca1b7292f5bff40 (patch)
treeb42f3344517850a4552f6b6e28f1b7aaa2e2a441 /sbin/tunefs/tunefs.c
parentf46ca0c8467d04e53808b38a55c69968c31dd87e (diff)
Added support for enabling soft updates.
Diffstat (limited to 'sbin/tunefs/tunefs.c')
-rw-r--r--sbin/tunefs/tunefs.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/sbin/tunefs/tunefs.c b/sbin/tunefs/tunefs.c
index db34d979262..185deaeeda8 100644
--- a/sbin/tunefs/tunefs.c
+++ b/sbin/tunefs/tunefs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tunefs.c,v 1.6 1997/10/06 20:22:38 deraadt Exp $ */
+/* $OpenBSD: tunefs.c,v 1.7 1997/11/06 20:27:16 csapuntz Exp $ */
/* $NetBSD: tunefs.c,v 1.10 1995/03/18 15:01:31 cgd Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)tunefs.c 8.2 (Berkeley) 4/19/94";
#else
-static char rcsid[] = "$OpenBSD: tunefs.c,v 1.6 1997/10/06 20:22:38 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: tunefs.c,v 1.7 1997/11/06 20:27:16 csapuntz Exp $";
#endif
#endif /* not lint */
@@ -90,7 +90,7 @@ main(argc, argv)
int argc;
char *argv[];
{
- char *cp, *special, *name;
+ char *cp, *special, *name, *action;
struct stat st;
int i;
int Aflag = 0;
@@ -190,6 +190,25 @@ again:
warnx(OPTWARN, "space", "<", MINFREE);
continue;
+ case 's':
+ name = "soft updates";
+ if (argc < 1)
+ errx(10, "-s: missing %s", name);
+ argc--, argv++;
+ if (strcmp(*argv, "enable") == 0) {
+ sblock.fs_flags |= FS_DOSOFTDEP;
+ action = "set";
+ } else if (strcmp(*argv, "disable") == 0) {
+ sblock.fs_flags &= ~FS_DOSOFTDEP;
+ action = "cleared";
+ } else {
+ errx(10, "bad %s (options are %s)",
+ name, "`enable' or `disable'");
+ }
+ warnx("%s %s", name, action);
+ continue;
+
+
case 'o':
name = "optimization preference";
if (argc < 1)
@@ -246,7 +265,8 @@ usage()
"\t-e maximum blocks per file in a cylinder group\n"
"\t-m minimum percentage of free space\n"
"\t-o optimization preference (`space' or `time')\n"
- "\t-p no change - just prints current tuneable settings\n",
+ "\t-p no change - just prints current tuneable settings\n"
+ "\t-s soft updates ('enable' or 'disable')\n",
__progname);
exit(2);
}
@@ -270,6 +290,8 @@ getsb(fs, file)
void
printfs()
{
+ warnx("soft updates: (-s) %s",
+ (sblock.fs_flags & FS_DOSOFTDEP) ? "yes" : "no");
warnx("maximum contiguous block count: (-a) %d",
sblock.fs_maxcontig);
warnx("rotational delay between contiguous blocks: (-d) %d ms",