diff options
author | David E. O'Brien <obrien@FreeBSD.org> | 2013-02-08 16:10:16 +0000 |
---|---|---|
committer | David E. O'Brien <obrien@FreeBSD.org> | 2013-02-08 16:10:16 +0000 |
commit | d9a447559bc04121f7c6682e64abe67efa154864 (patch) | |
tree | b2f038222ff8a70f687652441df00d2b564c8abe /usr.bin/nfsstat | |
parent | 3cbf5f97aafc2b249c509ee1162c47c9b28e591e (diff) | |
parent | fbda3d5daeeb730a49d025b614b35a32f0319718 (diff) | |
download | src-d9a447559bc04121f7c6682e64abe67efa154864.tar.gz src-d9a447559bc04121f7c6682e64abe67efa154864.zip |
Sync with HEAD.
Notes
Notes:
svn path=/projects/bmake/; revision=246555
Diffstat (limited to 'usr.bin/nfsstat')
-rw-r--r-- | usr.bin/nfsstat/nfsstat.1 | 10 | ||||
-rw-r--r-- | usr.bin/nfsstat/nfsstat.c | 26 |
2 files changed, 32 insertions, 4 deletions
diff --git a/usr.bin/nfsstat/nfsstat.1 b/usr.bin/nfsstat/nfsstat.1 index 14dc782f3107..2b0340d09273 100644 --- a/usr.bin/nfsstat/nfsstat.1 +++ b/usr.bin/nfsstat/nfsstat.1 @@ -28,7 +28,7 @@ .\" From: @(#)nfsstat.1 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd May 4, 2011 +.Dd November 14, 2012 .Dt NFSSTAT 1 .Os .Sh NAME @@ -38,7 +38,7 @@ statistics .Sh SYNOPSIS .Nm -.Op Fl ceoszW +.Op Fl cemoszW .Op Fl M Ar core .Op Fl N Ar system .Op Fl w Ar wait @@ -62,6 +62,12 @@ This option is incompatible with Extract values associated with the name list from the specified core instead of the default .Pa /dev/kmem . +.It Fl m +Report the mount options for all new NFS client mounts. +This option overrides all others and +.Nm +will exit after completing the report. +This option is only supported by the new NFS client. .It Fl N Extract the name list from the specified system instead of the default .Pa /boot/kernel/kernel . diff --git a/usr.bin/nfsstat/nfsstat.c b/usr.bin/nfsstat/nfsstat.c index efbaed5328b0..4a3228a8d597 100644 --- a/usr.bin/nfsstat/nfsstat.c +++ b/usr.bin/nfsstat/nfsstat.c @@ -107,14 +107,36 @@ main(int argc, char **argv) int ch; char *memf, *nlistf; char errbuf[_POSIX2_LINE_MAX]; + int mntlen, i; + char buf[1024]; + struct statfs *mntbuf; + struct nfscl_dumpmntopts dumpmntopts; interval = 0; memf = nlistf = NULL; - while ((ch = getopt(argc, argv, "cesWM:N:ow:z")) != -1) + while ((ch = getopt(argc, argv, "cesWM:mN:ow:z")) != -1) switch(ch) { case 'M': memf = optarg; break; + case 'm': + /* Display mount options for NFS mount points. */ + mntlen = getmntinfo(&mntbuf, MNT_NOWAIT); + for (i = 0; i < mntlen; i++) { + if (strcmp(mntbuf->f_fstypename, "nfs") == 0) { + dumpmntopts.ndmnt_fname = + mntbuf->f_mntonname; + dumpmntopts.ndmnt_buf = buf; + dumpmntopts.ndmnt_blen = sizeof(buf); + if (nfssvc(NFSSVC_DUMPMNTOPTS, + &dumpmntopts) >= 0) + printf("%s on %s\n%s\n", + mntbuf->f_mntfromname, + mntbuf->f_mntonname, buf); + } + mntbuf++; + } + exit(0); case 'N': nlistf = optarg; break; @@ -646,7 +668,7 @@ void usage(void) { (void)fprintf(stderr, - "usage: nfsstat [-ceoszW] [-M core] [-N system] [-w wait]\n"); + "usage: nfsstat [-cemoszW] [-M core] [-N system] [-w wait]\n"); exit(1); } |