Deleted Added
full compact
vfs_export.c (23333) vfs_export.c (23382)
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 22 unchanged lines hidden (view full) ---

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95
1/*
2 * Copyright (c) 1989, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 22 unchanged lines hidden (view full) ---

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95
39 * $Id: vfs_subr.c,v 1.77 1997/03/02 17:53:37 bde Exp $
39 * $Id: vfs_subr.c,v 1.78 1997/03/03 12:58:20 bde Exp $
40 */
41
42/*
43 * External virtual filesystem routines
44 */
45#include "opt_ddb.h"
46#include "opt_devfs.h"
47

--- 1594 unchanged lines hidden (view full) ---

1642 }
1643 simple_unlock(&mountlist_slock);
1644}
1645#endif
1646
1647/*
1648 * Top level filesystem related information gathering.
1649 */
40 */
41
42/*
43 * External virtual filesystem routines
44 */
45#include "opt_ddb.h"
46#include "opt_devfs.h"
47

--- 1594 unchanged lines hidden (view full) ---

1642 }
1643 simple_unlock(&mountlist_slock);
1644}
1645#endif
1646
1647/*
1648 * Top level filesystem related information gathering.
1649 */
1650extern int vfs_sysctl __P(SYSCTL_HANDLER_ARGS);
1651static int sysctl_ovfs_conf __P(SYSCTL_HANDLER_ARGS);
1652
1650static int sysctl_ovfs_conf __P(SYSCTL_HANDLER_ARGS);
1651
1653int
1652static int
1654vfs_sysctl SYSCTL_HANDLER_ARGS
1655{
1653vfs_sysctl SYSCTL_HANDLER_ARGS
1654{
1656 int *name = (int *)arg1;
1657 u_int namelen = arg2;
1655 int *name = (int *)arg1 - 1; /* XXX */
1656 u_int namelen = arg2 + 1; /* XXX */
1658 struct vfsconf *vfsp;
1659
1660#ifndef NO_COMPAT_PRELITE2
1661 /* Resolve ambiguity between VFS_VFSCONF and VFS_GENERIC. */
1657 struct vfsconf *vfsp;
1658
1659#ifndef NO_COMPAT_PRELITE2
1660 /* Resolve ambiguity between VFS_VFSCONF and VFS_GENERIC. */
1662 if (namelen == 1 && name[0] == VFS_VFSCONF)
1661 if (namelen == 1)
1663 return (sysctl_ovfs_conf(oidp, arg1, arg2, req));
1664#endif
1665
1662 return (sysctl_ovfs_conf(oidp, arg1, arg2, req));
1663#endif
1664
1665#ifdef notyet
1666 /* all sysctl names at this level are at least name and field */
1667 if (namelen < 2)
1668 return (ENOTDIR); /* overloaded */
1669 if (name[0] != VFS_GENERIC) {
1670 for (vfsp = vfsconf; vfsp; vfsp = vfsp->vfc_next)
1671 if (vfsp->vfc_typenum == name[0])
1672 break;
1673 if (vfsp == NULL)
1674 return (EOPNOTSUPP);
1666 /* all sysctl names at this level are at least name and field */
1667 if (namelen < 2)
1668 return (ENOTDIR); /* overloaded */
1669 if (name[0] != VFS_GENERIC) {
1670 for (vfsp = vfsconf; vfsp; vfsp = vfsp->vfc_next)
1671 if (vfsp->vfc_typenum == name[0])
1672 break;
1673 if (vfsp == NULL)
1674 return (EOPNOTSUPP);
1675#ifdef notyet
1676 return ((*vfsp->vfc_vfsops->vfs_sysctl)(&name[1], namelen - 1,
1677 oldp, oldlenp, newp, newlen, p));
1675 return ((*vfsp->vfc_vfsops->vfs_sysctl)(&name[1], namelen - 1,
1676 oldp, oldlenp, newp, newlen, p));
1678#else
1679 return (EOPNOTSUPP);
1680#endif
1681 }
1677 }
1678#endif
1682 switch (name[1]) {
1683 case VFS_MAXTYPENUM:
1684 if (namelen != 2)
1685 return (ENOTDIR);
1686 return (SYSCTL_OUT(req, &maxvfsconf, sizeof(int)));
1687 case VFS_CONF:
1688 if (namelen != 3)
1689 return (ENOTDIR); /* overloaded */
1690 for (vfsp = vfsconf; vfsp; vfsp = vfsp->vfc_next)
1691 if (vfsp->vfc_typenum == name[2])
1692 break;
1693 if (vfsp == NULL)
1694 return (EOPNOTSUPP);
1695 return (SYSCTL_OUT(req, vfsp, sizeof *vfsp));
1696 }
1697 return (EOPNOTSUPP);
1698}
1699
1679 switch (name[1]) {
1680 case VFS_MAXTYPENUM:
1681 if (namelen != 2)
1682 return (ENOTDIR);
1683 return (SYSCTL_OUT(req, &maxvfsconf, sizeof(int)));
1684 case VFS_CONF:
1685 if (namelen != 3)
1686 return (ENOTDIR); /* overloaded */
1687 for (vfsp = vfsconf; vfsp; vfsp = vfsp->vfc_next)
1688 if (vfsp->vfc_typenum == name[2])
1689 break;
1690 if (vfsp == NULL)
1691 return (EOPNOTSUPP);
1692 return (SYSCTL_OUT(req, vfsp, sizeof *vfsp));
1693 }
1694 return (EOPNOTSUPP);
1695}
1696
1697SYSCTL_NODE(_vfs, VFS_GENERIC, generic, CTLFLAG_RD, vfs_sysctl,
1698 "Generic filesystem");
1699
1700#ifndef NO_COMPAT_PRELITE2
1701
1702static int
1703sysctl_ovfs_conf SYSCTL_HANDLER_ARGS
1704{
1705 int error;
1706 struct vfsconf *vfsp;
1707 struct ovfsconf ovfs;

--- 372 unchanged lines hidden ---
1700#ifndef NO_COMPAT_PRELITE2
1701
1702static int
1703sysctl_ovfs_conf SYSCTL_HANDLER_ARGS
1704{
1705 int error;
1706 struct vfsconf *vfsp;
1707 struct ovfsconf ovfs;

--- 372 unchanged lines hidden ---