Define VLAYER and make layered fs's set this flag when creating their vnodes.
getnewvnode now checks this bit, and it if's set makes sure a vnode's not locked before removing it from the free list. Closes PR 7954 by Alan Barrett <apb@iafrica.com>.
This commit is contained in:
parent
7fa6616468
commit
a0f2937049
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: vfs_subr.c,v 1.104 1999/07/08 01:06:01 wrstuden Exp $ */
|
||||
/* $NetBSD: vfs_subr.c,v 1.105 1999/07/15 21:30:31 wrstuden Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -432,8 +432,15 @@ getnewvnode(tag, mp, vops, vpp)
|
|||
} else {
|
||||
for (vp = vnode_free_list.tqh_first;
|
||||
vp != NULLVP; vp = vp->v_freelist.tqe_next) {
|
||||
if (simple_lock_try(&vp->v_interlock))
|
||||
break;
|
||||
if (simple_lock_try(&vp->v_interlock)) {
|
||||
if ((vp->v_flag & VLAYER) == 0) {
|
||||
break;
|
||||
}
|
||||
if (VOP_ISLOCKED(vp) == 0)
|
||||
break;
|
||||
else
|
||||
simple_unlock(&vp->v_interlock);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Unless this is a bad time of the month, at most
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: layer_subr.c,v 1.2 1999/07/12 16:37:03 wrstuden Exp $ */
|
||||
/* $NetBSD: layer_subr.c,v 1.3 1999/07/15 21:30:32 wrstuden Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999 National Aeronautics & Space Administration
|
||||
|
@ -184,6 +184,7 @@ layer_node_alloc(mp, lowervp, vpp)
|
|||
&vp)) != 0)
|
||||
return (error);
|
||||
vp->v_type = lowervp->v_type;
|
||||
vp->v_flag |= VLAYER;
|
||||
|
||||
MALLOC(xp, struct layer_node *, lmp->layerm_size, M_TEMP, M_WAITOK);
|
||||
if (vp->v_type == VBLK || vp->v_type == VCHR) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: union_subr.c,v 1.33 1999/07/08 01:26:29 wrstuden Exp $ */
|
||||
/* $NetBSD: union_subr.c,v 1.34 1999/07/15 21:30:32 wrstuden Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994 Jan-Simon Pendry
|
||||
|
@ -312,7 +312,7 @@ union_allocvp(vpp, mp, undvp, dvp, cnp, uppervp, lowervp, docache)
|
|||
}
|
||||
|
||||
/* detect the root vnode (and aliases) */
|
||||
vflag = 0;
|
||||
vflag = VLAYER;
|
||||
if ((uppervp == um->um_uppervp) &&
|
||||
((lowervp == NULLVP) || lowervp == um->um_lowervp)) {
|
||||
if (lowervp == NULLVP) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: vnode.h,v 1.61 1999/07/07 23:30:03 wrstuden Exp $ */
|
||||
/* $NetBSD: vnode.h,v 1.62 1999/07/15 21:30:32 wrstuden Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1989, 1993
|
||||
|
@ -149,6 +149,7 @@ struct vnode {
|
|||
#define VBWAIT 0x0400 /* waiting for output to complete */
|
||||
#define VALIASED 0x0800 /* vnode has an alias */
|
||||
#define VDIROP 0x1000 /* LFS: vnode is involved in a directory op */
|
||||
#define VLAYER 0x2000 /* vnode is on a layer filesystem */
|
||||
|
||||
/*
|
||||
* Vnode attributes. A field value of VNOVAL represents a field whose value
|
||||
|
|
Loading…
Reference in New Issue