From 63ae415aca7fea68d536c633cda385017d8b3afd Mon Sep 17 00:00:00 2001 From: bde Date: Tue, 30 Jul 1996 18:00:32 +0000 Subject: [PATCH] Only use the special bdevvp() for DEVFS if DEVFS_ROOT is defined. This makes option DEVFS safe to use again (although mounting devfs is unsafe). --- sys/kern/vfs_export.c | 6 +++--- sys/kern/vfs_subr.c | 6 +++--- sys/miscfs/devfs/devfs_tree.c | 4 +++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sys/kern/vfs_export.c b/sys/kern/vfs_export.c index 53747dc02f1e..3070b3e313da 100644 --- a/sys/kern/vfs_export.c +++ b/sys/kern/vfs_export.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94 - * $Id: vfs_subr.c,v 1.55 1996/07/12 07:41:34 bde Exp $ + * $Id: vfs_subr.c,v 1.56 1996/07/24 21:21:43 phk Exp $ */ /* @@ -672,7 +672,7 @@ reassignbuf(bp, newvp) } } -#ifndef DEVFS +#ifndef DEVFS_ROOT /* * Create a vnode for a block device. * Used for root filesystem, argdev, and swap areas. @@ -703,8 +703,8 @@ bdevvp(dev, vpp) *vpp = vp; return (0); } +#endif /* !DEVFS_ROOT */ -#endif /* !DEVFS */ /* * Check to see if the new vnode represents a special device * for which we already have a vnode (either because of diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 53747dc02f1e..3070b3e313da 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)vfs_subr.c 8.13 (Berkeley) 4/18/94 - * $Id: vfs_subr.c,v 1.55 1996/07/12 07:41:34 bde Exp $ + * $Id: vfs_subr.c,v 1.56 1996/07/24 21:21:43 phk Exp $ */ /* @@ -672,7 +672,7 @@ reassignbuf(bp, newvp) } } -#ifndef DEVFS +#ifndef DEVFS_ROOT /* * Create a vnode for a block device. * Used for root filesystem, argdev, and swap areas. @@ -703,8 +703,8 @@ bdevvp(dev, vpp) *vpp = vp; return (0); } +#endif /* !DEVFS_ROOT */ -#endif /* !DEVFS */ /* * Check to see if the new vnode represents a special device * for which we already have a vnode (either because of diff --git a/sys/miscfs/devfs/devfs_tree.c b/sys/miscfs/devfs/devfs_tree.c index 0db8960a6c20..6342ceff0488 100644 --- a/sys/miscfs/devfs/devfs_tree.c +++ b/sys/miscfs/devfs/devfs_tree.c @@ -2,7 +2,7 @@ /* * Written by Julian Elischer (julian@DIALix.oz.au) * - * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.25 1996/06/12 05:08:29 gpalmer Exp $ + * $Header: /home/ncvs/src/sys/miscfs/devfs/devfs_tree.c,v 1.26 1996/07/24 21:22:36 phk Exp $ */ #include "param.h" @@ -783,6 +783,7 @@ DBPRINT((" vntodn ")); return(0); } +#ifdef DEVFS_ROOT static dn_p findbdev(dev_t dev, dn_p dir) { @@ -818,6 +819,7 @@ bdevvp(dev_t dev, struct vnode **vpp) return (0); return (devfs_dntovn(dnp, vpp)); } +#endif /* DEVFS_ROOT */ /***************************************************************\ * given a dev_node, find the appropriate vnode if one is already*