Module Name: src Committed By: christos Date: Wed Feb 17 23:30:21 UTC 2010
Modified Files: src/sbin/fsck: fsck.8 fsck.c Log Message: Add -x <mountpoint> ``exclude'' option. To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sbin/fsck/fsck.8 cvs rdiff -u -r1.47 -r1.48 src/sbin/fsck/fsck.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/fsck/fsck.8 diff -u src/sbin/fsck/fsck.8:1.35 src/sbin/fsck/fsck.8:1.36 --- src/sbin/fsck/fsck.8:1.35 Tue Oct 20 21:07:46 2009 +++ src/sbin/fsck/fsck.8 Wed Feb 17 18:30:21 2010 @@ -1,4 +1,4 @@ -.\" $NetBSD: fsck.8,v 1.35 2009/10/21 01:07:46 snj Exp $ +.\" $NetBSD: fsck.8,v 1.36 2010/02/17 23:30:21 christos Exp $ .\" .\" Copyright (c) 1996 Christos Zoulas. All rights reserved. .\" @@ -22,7 +22,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd February 23, 2008 +.Dd February 17, 2010 .Dt FSCK 8 .Os .Sh NAME @@ -34,6 +34,7 @@ .Op Fl l Ar maxparallel .Op Fl T Ar fstype:fsoptions .Op Fl t Ar fstype +.Op Fl x Ar mountpoint .Op special | node ... .Sh DESCRIPTION The @@ -111,6 +112,12 @@ for the file system types that are not specified in the list. .It Fl v Print the commands before executing them. +.It Fl x Ar mountpoint +Exclude the filesystem which has a +.Ar mountpoint +the same as in +.Pa /etc/fstab . +Used only in ``preen'' mode. .It Fl y Causes .Nm Index: src/sbin/fsck/fsck.c diff -u src/sbin/fsck/fsck.c:1.47 src/sbin/fsck/fsck.c:1.48 --- src/sbin/fsck/fsck.c:1.47 Sat Feb 23 16:41:47 2008 +++ src/sbin/fsck/fsck.c Wed Feb 17 18:30:21 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: fsck.c,v 1.47 2008/02/23 21:41:47 christos Exp $ */ +/* $NetBSD: fsck.c,v 1.48 2010/02/17 23:30:21 christos Exp $ */ /* * Copyright (c) 1996 Christos Zoulas. All rights reserved. @@ -36,7 +36,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: fsck.c,v 1.47 2008/02/23 21:41:47 christos Exp $"); +__RCSID("$NetBSD: fsck.c,v 1.48 2010/02/17 23:30:21 christos Exp $"); #endif /* not lint */ #include <sys/param.h> @@ -67,7 +67,7 @@ static enum { IN_LIST, NOT_IN_LIST } which = NOT_IN_LIST; -TAILQ_HEAD(fstypelist, entry) opthead, selhead; +TAILQ_HEAD(fstypelist, entry) opthead, selhead, omhead; struct entry { char *type; @@ -81,6 +81,7 @@ static int checkfs(const char *, const char *, const char *, void *, pid_t *); static int selected(const char *); +static int omitted(const char *); static void addoption(char *); static const char *getoptions(const char *); static void addentry(struct fstypelist *, const char *, const char *); @@ -105,8 +106,9 @@ TAILQ_INIT(&selhead); TAILQ_INIT(&opthead); + TAILQ_INIT(&omhead); - while ((i = getopt(argc, argv, "dfl:nPpqT:t:vy")) != -1) { + while ((i = getopt(argc, argv, "dfl:nPpqT:t:vx:y")) != -1) { switch (i) { case 'd': flags |= CHECK_DEBUG; @@ -152,6 +154,10 @@ flags |= CHECK_VERBOSE; continue; + case 'x': + addentry(&omhead, optarg, ""); + break; + case 'y': break; @@ -236,6 +242,9 @@ if (!selected(fs->fs_vfstype)) return NULL; + if (omitted(fs->fs_file)) + return NULL; + return fs; } @@ -391,6 +400,20 @@ } +static int +omitted(const char *mountedon) +{ + struct entry *e; + + /* If no type specified, it's always selected. */ + TAILQ_FOREACH(e, &omhead, entries) + if (!strcmp(e->type, mountedon)) + return 1; + + return 0; +} + + static const char * getoptions(const char *type) { @@ -558,7 +581,7 @@ usage(void) { static const char common[] = - "[-dfnPpqvy] [-l maxparallel] [-T fstype:fsoptions]\n\t\t[-t fstype]"; + "[-dfnPpqvy] [-x excludemount] [-l maxparallel] [-T fstype:fsoptions]\n\t\t[-t fstype]"; (void)fprintf(stderr, "usage: %s %s [special|node]...\n", getprogname(), common);