From 4a8b966013ccb0d66890169cec0a983dc4ee2d57 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Tue, 4 Mar 1997 18:31:56 +0000 Subject: [PATCH] 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. --- sys/kern/kern_mib.c | 5 ++--- sys/kern/vfs_export.c | 20 ++++++++++---------- sys/kern/vfs_subr.c | 20 ++++++++++---------- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c index c19a269260d6..8105aa495de6 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 @@ -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 0f65e6654866..b9ef8f314acb 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 0f65e6654866..b9ef8f314acb 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