From 10c5ccc30ae8155c4d8bd25aeffd9ed0e476c387 Mon Sep 17 00:00:00 2001 From: julian Date: Sun, 8 Mar 1998 09:59:44 +0000 Subject: Reviewed by: dyson@freebsd.org (john Dyson), dg@root.com (david greenman) Submitted by: Kirk McKusick (mcKusick@mckusick.com) Obtained from: WHistle development tree --- sbin/tunefs/tunefs.8 | 1 + sbin/tunefs/tunefs.c | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) (limited to 'sbin/tunefs') diff --git a/sbin/tunefs/tunefs.8 b/sbin/tunefs/tunefs.8 index df161a9..3d01447 100644 --- a/sbin/tunefs/tunefs.8 +++ b/sbin/tunefs/tunefs.8 @@ -46,6 +46,7 @@ .Op Fl m Ar minfree .Op Fl p .Bk -words +.Op Fl n Ar soft_dependency_enabling .Op Fl o Ar optimize_preference .Ek .Op Ar special | Ar filesys diff --git a/sbin/tunefs/tunefs.c b/sbin/tunefs/tunefs.c index 1802f22..b1df99b 100644 --- a/sbin/tunefs/tunefs.c +++ b/sbin/tunefs/tunefs.c @@ -81,7 +81,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; @@ -182,6 +182,24 @@ again: warnx(OPTWARN, "space", "<", MINFREE); continue; + case 'n': + 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) @@ -237,6 +255,7 @@ usage() fprintf(stderr, "\t-d rotational delay between contiguous blocks\n"); fprintf(stderr, "\t-e maximum blocks per file in a cylinder group\n"); fprintf(stderr, "\t-m minimum percentage of free space\n"); + fprintf(stderr, "\t-n soft updates (`enable' or `disable')\n"); fprintf(stderr, "\t-o optimization preference (`space' or `time')\n"); fprintf(stderr, "\t-p no change - just prints current tuneable settings\n"); exit(2); @@ -261,6 +280,8 @@ getsb(fs, file) void printfs() { + warnx("soft updates: (-n) %s", + (sblock.fs_flags & FS_DOSOFTDEP)? "enabled" : "disabled"); warnx("maximum contiguous block count: (-a) %d", sblock.fs_maxcontig); warnx("rotational delay between contiguous blocks: (-d) %d ms", -- cgit v1.1