summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1997-03-04 18:31:56 +0000
committerbde <bde@FreeBSD.org>1997-03-04 18:31:56 +0000
commit61a92b4f52edf5aaf3f135a45cd31c73e9f22916 (patch)
treefb6fa5996e05b55e4d2b9be5d264419032635917 /sys
parent4d01bbdf71fde1b95bfc8dd3a1c4330fac3fae89 (diff)
downloadFreeBSD-src-61a92b4f52edf5aaf3f135a45cd31c73e9f22916.zip
FreeBSD-src-61a92b4f52edf5aaf3f135a45cd31c73e9f22916.tar.gz
Attach vfs_sysctl() one level lower so that only the levels below
VFS_GENERIC aren't done in the FreeBSD way. The previous commit broke the nfs sysctls.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_mib.c5
-rw-r--r--sys/kern/vfs_export.c20
-rw-r--r--sys/kern/vfs_subr.c20
3 files changed, 22 insertions, 23 deletions
diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c
index c19a269..8105aa4 100644
--- a/sys/kern/kern_mib.c
+++ b/sys/kern/kern_mib.c
@@ -37,7 +37,7 @@
* SUCH DAMAGE.
*
* @(#)kern_sysctl.c 8.4 (Berkeley) 4/14/94
- * $Id: kern_mib.c,v 1.6 1997/02/22 09:39:07 peter Exp $
+ * $Id: kern_mib.c,v 1.7 1997/03/03 12:58:19 bde Exp $
*/
#include <sys/param.h>
@@ -53,8 +53,7 @@ SYSCTL_NODE(, CTL_KERN, kern, CTLFLAG_RW, 0,
"High kernel, proc, limits &c");
SYSCTL_NODE(, CTL_VM, vm, CTLFLAG_RW, 0,
"Virtual memory");
-extern int vfs_sysctl __P(SYSCTL_HANDLER_ARGS);
-SYSCTL_NODE(, CTL_VFS, vfs, CTLFLAG_RD, vfs_sysctl,
+SYSCTL_NODE(, CTL_VFS, vfs, CTLFLAG_RW, 0,
"File system");
SYSCTL_NODE(, CTL_NET, net, CTLFLAG_RW, 0,
"Network, (see socket.h)");
diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c
index 0f65e66..b9ef8f3 100644
--- a/sys/kern/vfs_export.c
+++ b/sys/kern/vfs_export.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95
- * $Id: vfs_subr.c,v 1.77 1997/03/02 17:53:37 bde Exp $
+ * $Id: vfs_subr.c,v 1.78 1997/03/03 12:58:20 bde Exp $
*/
/*
@@ -1647,22 +1647,22 @@ printlockedvnodes()
/*
* Top level filesystem related information gathering.
*/
-extern int vfs_sysctl __P(SYSCTL_HANDLER_ARGS);
static int sysctl_ovfs_conf __P(SYSCTL_HANDLER_ARGS);
-int
+static int
vfs_sysctl SYSCTL_HANDLER_ARGS
{
- int *name = (int *)arg1;
- u_int namelen = arg2;
+ int *name = (int *)arg1 - 1; /* XXX */
+ u_int namelen = arg2 + 1; /* XXX */
struct vfsconf *vfsp;
#ifndef NO_COMPAT_PRELITE2
/* Resolve ambiguity between VFS_VFSCONF and VFS_GENERIC. */
- if (namelen == 1 && name[0] == VFS_VFSCONF)
+ if (namelen == 1)
return (sysctl_ovfs_conf(oidp, arg1, arg2, req));
#endif
+#ifdef notyet
/* all sysctl names at this level are at least name and field */
if (namelen < 2)
return (ENOTDIR); /* overloaded */
@@ -1672,13 +1672,10 @@ vfs_sysctl SYSCTL_HANDLER_ARGS
break;
if (vfsp == NULL)
return (EOPNOTSUPP);
-#ifdef notyet
return ((*vfsp->vfc_vfsops->vfs_sysctl)(&name[1], namelen - 1,
oldp, oldlenp, newp, newlen, p));
-#else
- return (EOPNOTSUPP);
-#endif
}
+#endif
switch (name[1]) {
case VFS_MAXTYPENUM:
if (namelen != 2)
@@ -1697,6 +1694,9 @@ vfs_sysctl SYSCTL_HANDLER_ARGS
return (EOPNOTSUPP);
}
+SYSCTL_NODE(_vfs, VFS_GENERIC, generic, CTLFLAG_RD, vfs_sysctl,
+ "Generic filesystem");
+
#ifndef NO_COMPAT_PRELITE2
static int
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 0f65e66..b9ef8f3 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95
- * $Id: vfs_subr.c,v 1.77 1997/03/02 17:53:37 bde Exp $
+ * $Id: vfs_subr.c,v 1.78 1997/03/03 12:58:20 bde Exp $
*/
/*
@@ -1647,22 +1647,22 @@ printlockedvnodes()
/*
* Top level filesystem related information gathering.
*/
-extern int vfs_sysctl __P(SYSCTL_HANDLER_ARGS);
static int sysctl_ovfs_conf __P(SYSCTL_HANDLER_ARGS);
-int
+static int
vfs_sysctl SYSCTL_HANDLER_ARGS
{
- int *name = (int *)arg1;
- u_int namelen = arg2;
+ int *name = (int *)arg1 - 1; /* XXX */
+ u_int namelen = arg2 + 1; /* XXX */
struct vfsconf *vfsp;
#ifndef NO_COMPAT_PRELITE2
/* Resolve ambiguity between VFS_VFSCONF and VFS_GENERIC. */
- if (namelen == 1 && name[0] == VFS_VFSCONF)
+ if (namelen == 1)
return (sysctl_ovfs_conf(oidp, arg1, arg2, req));
#endif
+#ifdef notyet
/* all sysctl names at this level are at least name and field */
if (namelen < 2)
return (ENOTDIR); /* overloaded */
@@ -1672,13 +1672,10 @@ vfs_sysctl SYSCTL_HANDLER_ARGS
break;
if (vfsp == NULL)
return (EOPNOTSUPP);
-#ifdef notyet
return ((*vfsp->vfc_vfsops->vfs_sysctl)(&name[1], namelen - 1,
oldp, oldlenp, newp, newlen, p));
-#else
- return (EOPNOTSUPP);
-#endif
}
+#endif
switch (name[1]) {
case VFS_MAXTYPENUM:
if (namelen != 2)
@@ -1697,6 +1694,9 @@ vfs_sysctl SYSCTL_HANDLER_ARGS
return (EOPNOTSUPP);
}
+SYSCTL_NODE(_vfs, VFS_GENERIC, generic, CTLFLAG_RD, vfs_sysctl,
+ "Generic filesystem");
+
#ifndef NO_COMPAT_PRELITE2
static int
OpenPOWER on IntegriCloud