summaryrefslogtreecommitdiff
path: root/sys/miscfs/nullfs/null_subr.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/miscfs/nullfs/null_subr.c')
-rw-r--r--sys/miscfs/nullfs/null_subr.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/sys/miscfs/nullfs/null_subr.c b/sys/miscfs/nullfs/null_subr.c
index 8c77df2348d..930b1c632a9 100644
--- a/sys/miscfs/nullfs/null_subr.c
+++ b/sys/miscfs/nullfs/null_subr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: null_subr.c,v 1.4 1997/09/11 05:26:12 millert Exp $ */
+/* $OpenBSD: null_subr.c,v 1.5 1997/10/06 15:19:06 csapuntz Exp $ */
/* $NetBSD: null_subr.c,v 1.6 1996/05/10 22:50:52 jtk Exp $ */
/*
@@ -42,6 +42,7 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/proc.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/vnode.h>
@@ -67,7 +68,6 @@
LIST_HEAD(null_node_hashhead, null_node) *null_node_hashtbl;
u_long null_node_hash;
-void nullfs_init __P((void));
static struct vnode *
null_node_find __P((struct mount *, struct vnode *));
static int
@@ -75,14 +75,17 @@ static int
/*
* Initialise cache headers
*/
-void
-nullfs_init()
+/*ARGSUSED*/
+int
+nullfs_init(vfsp)
+ struct vfsconf *vfsp;
{
#ifdef NULLFS_DIAGNOSTIC
printf("nullfs_init\n"); /* printed during system boot */
#endif
null_node_hashtbl = hashinit(NNULLNODECACHE, M_CACHE, &null_node_hash);
+ return (0);
}
/*
@@ -96,6 +99,7 @@ null_node_find(mp, lowervp)
struct null_node_hashhead *hd;
struct null_node *a;
struct vnode *vp;
+ struct proc *p = curproc;
/*
* Find hash base, and then search the (two-way) linked
@@ -113,7 +117,7 @@ loop:
* stuff, but we don't want to lock
* the lower node.
*/
- if (vget(vp, 0)) {
+ if (vget(vp, 0, p)) {
printf ("null_node_find: vget failed.\n");
goto loop;
};
@@ -141,6 +145,7 @@ null_node_alloc(mp, lowervp, vpp)
struct vnode *vp, *nvp;
int error;
extern int (**dead_vnodeop_p) __P((void *));
+ struct proc *p = curproc;
if ((error = getnewvnode(VT_NULL, mp, null_vnodeop_p, &vp)) != 0)
return (error);
@@ -206,14 +211,14 @@ loop:
vgone(cvp);
goto loop;
}
- if (vget(cvp, 0)) /* can't lock; will die! */
+ if (vget(cvp, 0, p)) /* can't lock; will die! */
goto loop;
break;
}
vp->v_hashchain = cvpp;
vp->v_specnext = *cvpp;
- vp->v_specflags = 0;
+ vp->v_specmountpoint = NULL;
*cvpp = vp;
#ifdef DIAGNOSTIC
if (cvp == NULLVP)
@@ -249,6 +254,7 @@ null_node_create(mp, lowervp, newvpp, takelock)
int takelock;
{
struct vnode *aliasvp;
+ struct proc *p = curproc; /* XXX */
if ((aliasvp = null_node_find(mp, lowervp)) != NULL) {
/*
@@ -297,7 +303,7 @@ null_node_create(mp, lowervp, newvpp, takelock)
upper layer lock */
VTONULL(aliasvp)->null_flags |= NULL_LLOCK;
if (takelock)
- VOP_LOCK(aliasvp);
+ vn_lock(aliasvp, LK_EXCLUSIVE | LK_RETRY, p);
*newvpp = aliasvp;
return (0);