diff options
author | wollman <wollman@FreeBSD.org> | 1994-10-23 23:26:18 +0000 |
---|---|---|
committer | wollman <wollman@FreeBSD.org> | 1994-10-23 23:26:18 +0000 |
commit | a9f28ccb91ab50e877abb29ad84b5d50562048bb (patch) | |
tree | bc43b9ec1138e7190337db179f03ed4f972d4341 /sys/nfsclient/nfs_vfsops.c | |
parent | d958f3e8e7f059b4398a5025a72f86d6cb0362f6 (diff) | |
download | FreeBSD-src-a9f28ccb91ab50e877abb29ad84b5d50562048bb.zip FreeBSD-src-a9f28ccb91ab50e877abb29ad84b5d50562048bb.tar.gz |
Implement fs.nfs MIB variables.
Diffstat (limited to 'sys/nfsclient/nfs_vfsops.c')
-rw-r--r-- | sys/nfsclient/nfs_vfsops.c | 51 |
1 files changed, 50 insertions, 1 deletions
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; + } +} + |