summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1994-10-23 23:26:18 +0000
committerwollman <wollman@FreeBSD.org>1994-10-23 23:26:18 +0000
commita9f28ccb91ab50e877abb29ad84b5d50562048bb (patch)
treebc43b9ec1138e7190337db179f03ed4f972d4341 /sys/nfsclient
parentd958f3e8e7f059b4398a5025a72f86d6cb0362f6 (diff)
downloadFreeBSD-src-a9f28ccb91ab50e877abb29ad84b5d50562048bb.zip
FreeBSD-src-a9f28ccb91ab50e877abb29ad84b5d50562048bb.tar.gz
Implement fs.nfs MIB variables.
Diffstat (limited to 'sys/nfsclient')
-rw-r--r--sys/nfsclient/nfs.h14
-rw-r--r--sys/nfsclient/nfs_vfsops.c51
-rw-r--r--sys/nfsclient/nfsargs.h14
-rw-r--r--sys/nfsclient/nfsstats.h14
4 files changed, 86 insertions, 7 deletions
diff --git a/sys/nfsclient/nfs.h b/sys/nfsclient/nfs.h
index c79eefb..e77353f 100644
--- a/sys/nfsclient/nfs.h
+++ b/sys/nfsclient/nfs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.1 (Berkeley) 6/10/93
- * $Id: nfs.h,v 1.5 1994/10/02 17:26:54 phk Exp $
+ * $Id: nfs.h,v 1.6 1994/10/17 17:47:30 phk Exp $
*/
#ifndef _NFS_NFS_H_
@@ -156,6 +156,16 @@ struct nfsstats {
#define NFSSVC_MNTD 0x100
/*
+ * fs.nfs sysctl(3) identifiers
+ */
+#define NFS_NFSSTATS 1 /* struct: struct nfsstats */
+
+#define FS_NFS_NAMES { \
+ { 0, 0 }, \
+ { "nfsstats", CTLTYPE_STRUCT }, \
+}
+
+/*
* The set of signals the interrupt an I/O in progress for NFSMNT_INT mounts.
* What should be in this set is open to debate, but I believe that since
* I/O system calls on ufs are never interrupted by signals the set should
@@ -211,7 +221,7 @@ TAILQ_HEAD(, nfsreq) nfs_reqq;
#define R_MUSTRESEND 0x40 /* Must resend request */
#define R_GETONEREP 0x80 /* Probe for one reply only */
-struct nfsstats nfsstats;
+extern struct nfsstats nfsstats;
/*
* A list of nfssvc_sock structures is maintained with all the sockets
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index 5e7bd7d..5d7d9c4 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs_vfsops.c 8.3 (Berkeley) 1/4/94
- * $Id: nfs_vfsops.c,v 1.6 1994/10/17 17:47:39 phk Exp $
+ * $Id: nfs_vfsops.c,v 1.7 1994/10/22 17:52:59 phk Exp $
*/
#include <sys/param.h>
@@ -66,6 +66,10 @@
#include <nfs/nfsdiskless.h>
#include <nfs/nqnfs.h>
+struct nfsstats nfsstats;
+static int nfs_sysctl(int *, u_int, void *, size_t *, void *, size_t,
+ struct proc *);
+
/*
* nfs vfs operations.
*/
@@ -81,6 +85,7 @@ struct vfsops nfs_vfsops = {
nfs_fhtovp,
nfs_vptofh,
nfs_init,
+ nfs_sysctl
};
VFS_SET(nfs_vfsops, nfs, MOUNT_NFS, 0);
@@ -772,3 +777,47 @@ nfs_quotactl(mp, cmd, uid, arg, p)
return (EOPNOTSUPP);
}
+
+/*
+ * Do that sysctl thang...
+ */
+static int
+nfs_sysctl(int *name, u_int namelen, void *oldp, size_t *oldlenp, void *newp,
+ size_t newlen, struct proc *p)
+{
+ int rv;
+
+ /*
+ * All names at this level are terminal.
+ */
+ if(namelen > 1)
+ return ENOTDIR; /* overloaded */
+
+ switch(name[0]) {
+ case NFS_NFSSTATS:
+ if(!oldp) {
+ *oldlenp = sizeof nfsstats;
+ return 0;
+ }
+
+ if(*oldlenp < sizeof nfsstats) {
+ *oldlenp = sizeof nfsstats;
+ return ENOMEM;
+ }
+
+ rv = copyout(&nfsstats, oldp, sizeof nfsstats);
+ if(rv) return rv;
+
+ if(newp && newlen != sizeof nfsstats)
+ return EINVAL;
+
+ if(newp) {
+ return copyin(newp, &nfsstats, sizeof nfsstats);
+ }
+ return 0;
+
+ default:
+ return EOPNOTSUPP;
+ }
+}
+
diff --git a/sys/nfsclient/nfsargs.h b/sys/nfsclient/nfsargs.h
index c79eefb..e77353f 100644
--- a/sys/nfsclient/nfsargs.h
+++ b/sys/nfsclient/nfsargs.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.1 (Berkeley) 6/10/93
- * $Id: nfs.h,v 1.5 1994/10/02 17:26:54 phk Exp $
+ * $Id: nfs.h,v 1.6 1994/10/17 17:47:30 phk Exp $
*/
#ifndef _NFS_NFS_H_
@@ -156,6 +156,16 @@ struct nfsstats {
#define NFSSVC_MNTD 0x100
/*
+ * fs.nfs sysctl(3) identifiers
+ */
+#define NFS_NFSSTATS 1 /* struct: struct nfsstats */
+
+#define FS_NFS_NAMES { \
+ { 0, 0 }, \
+ { "nfsstats", CTLTYPE_STRUCT }, \
+}
+
+/*
* The set of signals the interrupt an I/O in progress for NFSMNT_INT mounts.
* What should be in this set is open to debate, but I believe that since
* I/O system calls on ufs are never interrupted by signals the set should
@@ -211,7 +221,7 @@ TAILQ_HEAD(, nfsreq) nfs_reqq;
#define R_MUSTRESEND 0x40 /* Must resend request */
#define R_GETONEREP 0x80 /* Probe for one reply only */
-struct nfsstats nfsstats;
+extern struct nfsstats nfsstats;
/*
* A list of nfssvc_sock structures is maintained with all the sockets
diff --git a/sys/nfsclient/nfsstats.h b/sys/nfsclient/nfsstats.h
index c79eefb..e77353f 100644
--- a/sys/nfsclient/nfsstats.h
+++ b/sys/nfsclient/nfsstats.h
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* @(#)nfs.h 8.1 (Berkeley) 6/10/93
- * $Id: nfs.h,v 1.5 1994/10/02 17:26:54 phk Exp $
+ * $Id: nfs.h,v 1.6 1994/10/17 17:47:30 phk Exp $
*/
#ifndef _NFS_NFS_H_
@@ -156,6 +156,16 @@ struct nfsstats {
#define NFSSVC_MNTD 0x100
/*
+ * fs.nfs sysctl(3) identifiers
+ */
+#define NFS_NFSSTATS 1 /* struct: struct nfsstats */
+
+#define FS_NFS_NAMES { \
+ { 0, 0 }, \
+ { "nfsstats", CTLTYPE_STRUCT }, \
+}
+
+/*
* The set of signals the interrupt an I/O in progress for NFSMNT_INT mounts.
* What should be in this set is open to debate, but I believe that since
* I/O system calls on ufs are never interrupted by signals the set should
@@ -211,7 +221,7 @@ TAILQ_HEAD(, nfsreq) nfs_reqq;
#define R_MUSTRESEND 0x40 /* Must resend request */
#define R_GETONEREP 0x80 /* Probe for one reply only */
-struct nfsstats nfsstats;
+extern struct nfsstats nfsstats;
/*
* A list of nfssvc_sock structures is maintained with all the sockets
OpenPOWER on IntegriCloud