summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/nullfs/null_subr.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/sys/fs/nullfs/null_subr.c b/sys/fs/nullfs/null_subr.c
index f676b04..6bfae2c 100644
--- a/sys/fs/nullfs/null_subr.c
+++ b/sys/fs/nullfs/null_subr.c
@@ -169,17 +169,26 @@ null_hashins(mp, xp)
}
static void
-null_insmntque_dtr(struct vnode *vp, void *xp)
+null_destroy_proto(struct vnode *vp, void *xp)
{
- vput(((struct null_node *)xp)->null_lowervp);
+ VI_LOCK(vp);
vp->v_data = NULL;
vp->v_vnlock = &vp->v_lock;
- free(xp, M_NULLFSNODE);
vp->v_op = &dead_vnodeops;
+ VI_UNLOCK(vp);
(void) vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
vgone(vp);
vput(vp);
+ free(xp, M_NULLFSNODE);
+}
+
+static void
+null_insmntque_dtr(struct vnode *vp, void *xp)
+{
+
+ vput(((struct null_node *)xp)->null_lowervp);
+ null_destroy_proto(vp, xp);
}
/*
@@ -247,9 +256,7 @@ null_nodeget(mp, lowervp, vpp)
*vpp = null_hashins(mp, xp);
if (*vpp != NULL) {
vrele(lowervp);
- vp->v_vnlock = &vp->v_lock;
- xp->null_lowervp = NULL;
- vrele(vp);
+ null_destroy_proto(vp, xp);
return (0);
}
*vpp = vp;
OpenPOWER on IntegriCloud