summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Roberson <jeff@FreeBSD.org>2005-03-24 06:08:58 +0000
committerJeff Roberson <jeff@FreeBSD.org>2005-03-24 06:08:58 +0000
commitc167961e27e3e41e1d53ed76a9a6720510cf4e77 (patch)
tree2df5784df43150e6fcbe16525ec1f58a050bb8d0
parent3e6bcad3753ac40c30c4e022cca62e557bd2c3a2 (diff)
Notes
-rw-r--r--sys/kern/vfs_subr.c15
-rw-r--r--sys/sys/vnode.h1
2 files changed, 13 insertions, 3 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c
index 18ca28f20bc0..9668b58b7468 100644
--- a/sys/kern/vfs_subr.c
+++ b/sys/kern/vfs_subr.c
@@ -1927,7 +1927,11 @@ vput(vp)
if (vp->v_usecount == 1) {
v_incr_usecount(vp, -1);
- vinactive(vp, td);
+ if (VOP_ISLOCKED(vp, td) != LK_EXCLUSIVE &&
+ VOP_LOCK(vp, LK_EXCLUPGRADE, td) != 0)
+ vp->v_iflag |= VI_OWEINACT;
+ else
+ vinactive(vp, td);
VOP_UNLOCK(vp, 0, td);
if (VSHOULDFREE(vp))
vfree(vp);
@@ -2003,7 +2007,7 @@ vinactive(struct vnode *vp, struct thread *td)
VI_LOCK(vp);
VNASSERT(vp->v_iflag & VI_DOINGINACT, vp,
("vinactive: lost VI_DOINGINACT"));
- vp->v_iflag &= ~VI_DOINGINACT;
+ vp->v_iflag &= ~(VI_DOINGINACT|VI_OWEINACT);
}
/*
@@ -2250,6 +2254,11 @@ vgonel(struct vnode *vp, struct thread *td)
if ((vp->v_iflag & VI_DOINGINACT) == 0)
vinactive(vp, td);
VI_UNLOCK(vp);
+ } else {
+ VI_LOCK(vp);
+ if (vp->v_iflag & VI_OWEINACT)
+ vinactive(vp, td);
+ VI_UNLOCK(vp);
}
/*
* Reclaim the vnode.
@@ -2742,7 +2751,7 @@ vbusy(struct vnode *vp)
freevnodes--;
mtx_unlock(&vnode_free_list_mtx);
- vp->v_iflag &= ~(VI_FREE|VI_AGE);
+ vp->v_iflag &= ~(VI_FREE|VI_AGE|VI_OWEINACT);
}
/*
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 45e1880bc7e3..4f3cf38bff09 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -244,6 +244,7 @@ struct xvnode {
#define VI_FREE 0x0100 /* This vnode is on the freelist */
#define VI_OBJDIRTY 0x0400 /* object might be dirty */
#define VI_DOINGINACT 0x0800 /* VOP_INACTIVE is in progress */
+#define VI_OWEINACT 0x1000 /* Need to call inactive */
#define VV_ROOT 0x0001 /* root of its filesystem */
#define VV_ISTTY 0x0002 /* vnode represents a tty */