From 396d1744779b3f682f49685d570c24c324cf2221 Mon Sep 17 00:00:00 2001 From: pooka Date: Mon, 27 Aug 2007 23:15:26 +0000 Subject: [PATCH] allow to set ffs options with command-line -o XXX: can't mix puffs and ffs options in one -o foo,bar --- sys/rump/fs/bin/ffs/ffs.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/sys/rump/fs/bin/ffs/ffs.c b/sys/rump/fs/bin/ffs/ffs.c index 3183575ac20f..b6b8b9809edf 100644 --- a/sys/rump/fs/bin/ffs/ffs.c +++ b/sys/rump/fs/bin/ffs/ffs.c @@ -1,4 +1,4 @@ -/* $NetBSD: ffs.c,v 1.3 2007/08/14 15:56:16 pooka Exp $ */ +/* $NetBSD: ffs.c,v 1.4 2007/08/27 23:15:26 pooka Exp $ */ /* * Copyright (c) 2007 Antti Kantee. All Rights Reserved. @@ -39,6 +39,21 @@ #include "p2k.h" +/* XXX: figure out a proper way to share code/integrate with mount_ffs */ +static const struct mntopt ffsmopts[] = { + MOPT_STDOPTS, + MOPT_ASYNC, + MOPT_SYNC, + MOPT_UPDATE, + MOPT_RELOAD, + MOPT_NOATIME, + MOPT_NODEVMTIME, + MOPT_FORCE, + MOPT_SOFTDEP, + MOPT_GETARGS, + MOPT_NULL, +}; + static void usage(void) { @@ -55,14 +70,18 @@ main(int argc, char *argv[]) int rv, ch; setprogname(argv[0]); + getmnt_silent = 1; mntflags = pflags = 0; while ((ch = getopt(argc, argv, "o:")) != -1) { switch (ch) { case 'o': mp = getmntopts(optarg, puffsmopts, &mntflags, &pflags); - if (mp == NULL) - err(1, "getmntops"); + if (mp == NULL) { + mp = getmntopts(optarg, ffsmopts, &mntflags, 0); + if (mp == NULL) + err(1, "getmntops"); + } freemntopts(mp); break; default: