From f4493fbc1caeb2f68a130056f83c5c0015eefda1 Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 28 Mar 2005 09:35:58 +0000 Subject: [PATCH] - UFS no longer uses PDIRUNLOCK to track the parent state. Instead, we now rely on ufs to always leave the parent locked except in the ISDOTDOT case. Adjust asserts to deal with these changes. Sponsored by: Isilon Systems, Inc. --- sys/ufs/ufs/ufs_extattr.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c index 2d8ec43e9fc4..83d9662174d8 100644 --- a/sys/ufs/ufs/ufs_extattr.c +++ b/sys/ufs/ufs/ufs_extattr.c @@ -277,17 +277,15 @@ ufs_extattr_lookup(struct vnode *start_dvp, int lockparent, char *dirname, * Error condition, may have to release the lock on the parent * if ufs_lookup() didn't. */ - if (!(cnp.cn_flags & PDIRUNLOCK) && - (lockparent == UE_GETDIR_LOCKPARENT_DONT)) + if (lockparent == UE_GETDIR_LOCKPARENT_DONT) VOP_UNLOCK(start_dvp, 0, td); /* * Check that ufs_lookup() didn't release the lock when we * didn't want it to. */ - if ((cnp.cn_flags & PDIRUNLOCK) && - (lockparent == UE_GETDIR_LOCKPARENT)) - panic("ufs_extattr_lookup: lockparent but PDIRUNLOCK"); + if (lockparent == UE_GETDIR_LOCKPARENT) + ASSERT_VOP_LOCKED(start_dvp, "ufs_extattr_lookup"); return (error); } @@ -296,14 +294,11 @@ ufs_extattr_lookup(struct vnode *start_dvp, int lockparent, char *dirname, panic("ufs_extattr_lookup: target_vp == start_dvp"); */ - if (target_vp != start_dvp && - !(cnp.cn_flags & PDIRUNLOCK) && - (lockparent == UE_GETDIR_LOCKPARENT_DONT)) - panic("ufs_extattr_lookup: !lockparent but !PDIRUNLOCK"); + if (target_vp != start_dvp && lockparent == UE_GETDIR_LOCKPARENT_DONT) + VOP_UNLOCK(start_dvp, 0, td); - if ((cnp.cn_flags & PDIRUNLOCK) && - (lockparent == UE_GETDIR_LOCKPARENT)) - panic("ufs_extattr_lookup: lockparent but PDIRUNLOCK"); + if (lockparent == UE_GETDIR_LOCKPARENT) + ASSERT_VOP_LOCKED(start_dvp, "ufs_extattr_lookup"); /* printf("ufs_extattr_lookup: success\n"); */ *vp = target_vp;