summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs_vfsops.c
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2004-07-06 09:23:17 +0000
committeralfred <alfred@FreeBSD.org>2004-07-06 09:23:17 +0000
commit8fd8b8c57fb214d5cdc0aeaed49ca85a702f1507 (patch)
tree35045587b48f8e31ebf4f01f55af25984a0105ad /sys/nfsclient/nfs_vfsops.c
parentc05f2ebe921742f142496c086120ee8a02d16b90 (diff)
downloadFreeBSD-src-8fd8b8c57fb214d5cdc0aeaed49ca85a702f1507.zip
FreeBSD-src-8fd8b8c57fb214d5cdc0aeaed49ca85a702f1507.tar.gz
NFS mobility Phase VI:
Export NFS mount state via sysctl. Export timeout via sysctl.
Diffstat (limited to 'sys/nfsclient/nfs_vfsops.c')
-rw-r--r--sys/nfsclient/nfs_vfsops.c51
1 files changed, 50 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_vfsops.c b/sys/nfsclient/nfs_vfsops.c
index 5728607..0e98916 100644
--- a/sys/nfsclient/nfs_vfsops.c
+++ b/sys/nfsclient/nfs_vfsops.c
@@ -981,10 +981,59 @@ loop:
static int
nfs_sysctl(struct mount *mp, fsctlop_t op, struct sysctl_req *req)
{
+ struct nfsmount *nmp = VFSTONFS(mp);
+ struct vfsquery vq;
+ int error;
+ bzero(&vq, sizeof(vq));
switch (op) {
+#if 0
+ case VFS_CTL_NOLOCKS:
+ val = (nmp->nm_flag & NFSMNT_NOLOCKS) ? 1 : 0;
+ if (req->oldptr != NULL) {
+ error = SYSCTL_OUT(req, &val, sizeof(val));
+ if (error)
+ return (error);
+ }
+ if (req->newptr != NULL) {
+ error = SYSCTL_IN(req, &val, sizeof(val));
+ if (error)
+ return (error);
+ if (val)
+ nmp->nm_flag |= NFSMNT_NOLOCKS;
+ else
+ nmp->nm_flag &= ~NFSMNT_NOLOCKS;
+ }
+ break;
+#endif
+ case VFS_CTL_QUERY:
+ if (nmp->nm_state & NFSSTA_TIMEO)
+ vq.vq_flags |= VQ_NOTRESP;
+#if 0
+ if (!(nmp->nm_flag & NFSMNT_NOLOCKS) &&
+ (nmp->nm_state & NFSSTA_LOCKTIMEO))
+ vq.vq_flags |= VQ_NOTRESPLOCK;
+#endif
+ error = SYSCTL_OUT(req, &vq, sizeof(vq));
+ break;
+ case VFS_CTL_TIMEO:
+ if (req->oldptr != NULL) {
+ error = SYSCTL_OUT(req, &nmp->nm_tprintf_initial_delay,
+ sizeof(nmp->nm_tprintf_initial_delay));
+ if (error)
+ return (error);
+ }
+ if (req->newptr != NULL) {
+ error = SYSCTL_IN(req, &nmp->nm_tprintf_initial_delay,
+ sizeof(nmp->nm_tprintf_initial_delay));
+ if (error)
+ return (error);
+ if (nmp->nm_tprintf_initial_delay < 0)
+ nmp->nm_tprintf_initial_delay = 0;
+ }
+ break;
default:
- printf("nfs sysctl, op = %0X\n", (int) op);
+ return (ENOTSUP);
}
return (0);
}
OpenPOWER on IntegriCloud