diff options
| author | Kirk McKusick <mckusick@FreeBSD.org> | 2002-02-02 01:49:18 +0000 |
|---|---|---|
| committer | Kirk McKusick <mckusick@FreeBSD.org> | 2002-02-02 01:49:18 +0000 |
| commit | 64011154e56a0c2f87f4c0013e4ef5ed36d3ae5b (patch) | |
| tree | 4b9bff2b22a1824b424f5f96db6c16813f5dceeb /sys | |
| parent | 602a222d021c0e57f52b9f0e68c8252f8a505103 (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/kern/vfs_subr.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index 277430da4b6d8..3c61b17ba0fce 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1727,18 +1727,18 @@ vrele(vp) if (vp->v_usecount == 1) { vp->v_usecount--; + /* + * We must call VOP_INACTIVE with the node locked. + * If we are doing a vput, the node is already locked, + * but, in the case of vrele, we must explicitly lock + * the vnode before calling VOP_INACTIVE. + */ + if (vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK, td) == 0) + VOP_INACTIVE(vp, td); if (VSHOULDFREE(vp)) vfree(vp); else vlruvp(vp); - /* - * If we are doing a vput, the node is already locked, and we must - * call VOP_INACTIVE with the node locked. So, in the case of - * vrele, we explicitly lock the vnode before calling VOP_INACTIVE. - */ - if (vn_lock(vp, LK_EXCLUSIVE | LK_INTERLOCK, td) == 0) { - VOP_INACTIVE(vp, td); - } } else { #ifdef DIAGNOSTIC @@ -1776,17 +1776,17 @@ vput(vp) if (vp->v_usecount == 1) { vp->v_usecount--; + /* + * We must call VOP_INACTIVE with the node locked. + * If we are doing a vput, the node is already locked, + * so we just need to release the vnode mutex. + */ + mtx_unlock(&vp->v_interlock); + VOP_INACTIVE(vp, td); if (VSHOULDFREE(vp)) vfree(vp); else vlruvp(vp); - /* - * If we are doing a vput, the node is already locked, and we must - * call VOP_INACTIVE with the node locked. So, in the case of - * vrele, we explicitly lock the vnode before calling VOP_INACTIVE. - */ - mtx_unlock(&vp->v_interlock); - VOP_INACTIVE(vp, td); } else { #ifdef DIAGNOSTIC |
