From 5d14c414ecf3c23fdb53a01f09f8c5b253ff1874 Mon Sep 17 00:00:00 2001 From: Pawel Jakub Dawidek Date: Mon, 28 May 2007 00:28:15 +0000 Subject: [PATCH] - Remove unnecessary vnode internal locking - v_vflag is protect by vnode's lock (not vnode's interlock). - Simplify code a bit. --- sys/ufs/ufs/ufs_gjournal.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/sys/ufs/ufs/ufs_gjournal.c b/sys/ufs/ufs/ufs_gjournal.c index 7b98a6d7e4d3..dfa8531c67d0 100644 --- a/sys/ufs/ufs/ufs_gjournal.c +++ b/sys/ufs/ufs/ufs_gjournal.c @@ -105,39 +105,30 @@ ufs_gjournal_modref(struct vnode *vp, int count) } void -ufs_gjournal_orphan(struct vnode *fvp) +ufs_gjournal_orphan(struct vnode *vp) { - struct mount *mp; struct inode *ip; - mp = fvp->v_mount; - if (mp->mnt_gjprovider == NULL) + if (vp->v_mount->mnt_gjprovider == NULL) return; - VI_LOCK(fvp); - if (fvp->v_usecount < 2 || (fvp->v_vflag & VV_DELETED)) { - VI_UNLOCK(fvp); + if (vp->v_usecount < 2 || (vp->v_vflag & VV_DELETED)) + return; + ip = VTOI(vp); + if ((vp->v_type == VDIR && ip->i_nlink > 2) || + (vp->v_type != VDIR && ip->i_nlink > 1)) { return; } - ip = VTOI(fvp); - if ((fvp->v_type == VDIR && ip->i_nlink > 2) || - (fvp->v_type != VDIR && ip->i_nlink > 1)) { - VI_UNLOCK(fvp); - return; - } - fvp->v_vflag |= VV_DELETED; - VI_UNLOCK(fvp); + vp->v_vflag |= VV_DELETED; - ufs_gjournal_modref(fvp, 1); + ufs_gjournal_modref(vp, 1); } void ufs_gjournal_close(struct vnode *vp) { - struct mount *mp; struct inode *ip; - mp = vp->v_mount; - if (mp->mnt_gjprovider == NULL) + if (vp->v_mount->mnt_gjprovider == NULL) return; if (!(vp->v_vflag & VV_DELETED)) return;