diff options
-rw-r--r-- | bin/df/df.1 | 5 | ||||
-rw-r--r-- | bin/df/df.c | 15 | ||||
-rw-r--r-- | sys/kern/vfs_extattr.c | 4 | ||||
-rw-r--r-- | sys/kern/vfs_syscalls.c | 4 | ||||
-rw-r--r-- | sys/sys/mount.h | 4 |
5 files changed, 21 insertions, 11 deletions
diff --git a/bin/df/df.1 b/bin/df/df.1 index 9c875dc..eb97ccc 100644 --- a/bin/df/df.1 +++ b/bin/df/df.1 @@ -40,7 +40,7 @@ .Nd display free disk space .Sh SYNOPSIS .Nm df -.Op Fl ikn +.Op Fl aikn .Op Fl t Ar type .Op Ar file | Ar filesystem ... .Sh DESCRIPTION @@ -59,6 +59,9 @@ option below). .Pp The following options are available: .Bl -tag -width Ds +.It Fl a +Show all mount points, including those that were mounted with the MNT_IGNORE +flag. .It Fl i Include statistics on the number of free inodes. .It Fl k diff --git a/bin/df/df.c b/bin/df/df.c index b402efd..ebe9d84 100644 --- a/bin/df/df.c +++ b/bin/df/df.c @@ -73,7 +73,7 @@ void prtstat __P((struct statfs *, int)); int ufs_df __P((char *, int)); void usage __P((void)); -int iflag, nflag; +int aflag = 0, iflag, nflag; struct ufs_args mdev; int @@ -88,8 +88,11 @@ main(argc, argv) char *mntpt, *mntpath, **vfslist; vfslist = NULL; - while ((ch = getopt(argc, argv, "iknt:")) != -1) + while ((ch = getopt(argc, argv, "aiknt:")) != -1) switch (ch) { + case 'a': + aflag = 1; + break; case 'i': iflag = 1; break; @@ -130,8 +133,10 @@ main(argc, argv) maxwidth = width; } } - for (i = 0; i < mntsize; i++) - prtstat(&mntbuf[i], maxwidth); + for (i = 0; i < mntsize; i++) { + if (aflag || (mntbuf[i].f_flags & MNT_IGNORE) == 0) + prtstat(&mntbuf[i], maxwidth); + } exit(rv); } @@ -377,6 +382,6 @@ void usage() { (void)fprintf(stderr, - "usage: df [-ikn] [-t type] [file | filesystem ...]\n"); + "usage: df [-aikn] [-t type] [file | filesystem ...]\n"); exit(1); } diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c index 9e3efbb..c1f21e7 100644 --- a/sys/kern/vfs_extattr.c +++ b/sys/kern/vfs_extattr.c @@ -289,11 +289,11 @@ update: mp->mnt_kern_flag |= MNTK_WANTRDWR; mp->mnt_flag &=~ (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV | MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOATIME | - MNT_NOSYMFOLLOW | + MNT_NOSYMFOLLOW | MNT_IGNORE | MNT_NOCLUSTERR | MNT_NOCLUSTERW | MNT_SUIDDIR); mp->mnt_flag |= SCARG(uap, flags) & (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV | MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_FORCE | - MNT_NOSYMFOLLOW | + MNT_NOSYMFOLLOW | MNT_IGNORE | MNT_NOATIME | MNT_NOCLUSTERR | MNT_NOCLUSTERW | MNT_SUIDDIR); /* * Mount the filesystem. diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c index 9e3efbb..c1f21e7 100644 --- a/sys/kern/vfs_syscalls.c +++ b/sys/kern/vfs_syscalls.c @@ -289,11 +289,11 @@ update: mp->mnt_kern_flag |= MNTK_WANTRDWR; mp->mnt_flag &=~ (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV | MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_NOATIME | - MNT_NOSYMFOLLOW | + MNT_NOSYMFOLLOW | MNT_IGNORE | MNT_NOCLUSTERR | MNT_NOCLUSTERW | MNT_SUIDDIR); mp->mnt_flag |= SCARG(uap, flags) & (MNT_NOSUID | MNT_NOEXEC | MNT_NODEV | MNT_SYNCHRONOUS | MNT_UNION | MNT_ASYNC | MNT_FORCE | - MNT_NOSYMFOLLOW | + MNT_NOSYMFOLLOW | MNT_IGNORE | MNT_NOATIME | MNT_NOCLUSTERR | MNT_NOCLUSTERW | MNT_SUIDDIR); /* * Mount the filesystem. diff --git a/sys/sys/mount.h b/sys/sys/mount.h index ad0ed65..4d6764d 100644 --- a/sys/sys/mount.h +++ b/sys/sys/mount.h @@ -149,6 +149,7 @@ struct mount { #define MNT_QUOTA 0x00002000 /* quotas are enabled on filesystem */ #define MNT_ROOTFS 0x00004000 /* identifies the root filesystem */ #define MNT_USER 0x00008000 /* mounted by a user */ +#define MNT_IGNORE 0x00800000 /* do not show entry in df */ /* * Mask of flags that are visible to statfs() @@ -162,7 +163,8 @@ struct mount { MNT_DEFEXPORTED | MNT_EXPORTANON| MNT_EXKERB | \ MNT_LOCAL | MNT_USER | MNT_QUOTA | \ MNT_ROOTFS | MNT_NOATIME | MNT_NOCLUSTERR| \ - MNT_NOCLUSTERW | MNT_SUIDDIR | MNT_SOFTDEP \ + MNT_NOCLUSTERW | MNT_SUIDDIR | MNT_SOFTDEP | \ + MNT_IGNORE \ /* | MNT_EXPUBLIC */) /* * External filesystem command modifier flags. |