aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/vfs_cache.c
diff options
context:
space:
mode:
authorPawel Jakub Dawidek <pjd@FreeBSD.org>2008-04-09 20:19:55 +0000
committerPawel Jakub Dawidek <pjd@FreeBSD.org>2008-04-09 20:19:55 +0000
commitb03d7207604610551860ac6e6c2bc60ccfe3e465 (patch)
tree0862b672bad397dc2549ede4f1ac147947598462 /sys/kern/vfs_cache.c
parent6c6eaea6dd2d3dccaae01747dd4637c9d558fdf3 (diff)
downloadsrc-b03d7207604610551860ac6e6c2bc60ccfe3e465.tar.gz
src-b03d7207604610551860ac6e6c2bc60ccfe3e465.zip
- Use LK_TYPE_MASK where needed. Actually after sys/sys/lockmgr.h:1.69 it is
no longer needed, but for now we still want to be consistent with other similar checks in the tree. - Call ASSERT_VOP_ELOCKED() only when vget() returns 0. Reviewed by: jeff
Notes
Notes: svn path=/head/; revision=178046
Diffstat (limited to 'sys/kern/vfs_cache.c')
-rw-r--r--sys/kern/vfs_cache.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c
index 3d254f386b56..0f12f962f78b 100644
--- a/sys/kern/vfs_cache.c
+++ b/sys/kern/vfs_cache.c
@@ -423,7 +423,7 @@ success:
* When we lookup "." we still can be asked to lock it
* differently...
*/
- ltype = cnp->cn_lkflags & (LK_SHARED | LK_EXCLUSIVE);
+ ltype = cnp->cn_lkflags & LK_TYPE_MASK;
if (ltype == VOP_ISLOCKED(*vpp))
return (-1);
else if (ltype == LK_EXCLUSIVE)
@@ -440,12 +440,14 @@ success:
error = vget(*vpp, cnp->cn_lkflags | LK_INTERLOCK, cnp->cn_thread);
if (cnp->cn_flags & ISDOTDOT)
vn_lock(dvp, ltype | LK_RETRY);
- if ((cnp->cn_flags & ISLASTCN) && (cnp->cn_lkflags & LK_EXCLUSIVE))
- ASSERT_VOP_ELOCKED(*vpp, "cache_lookup");
if (error) {
*vpp = NULL;
goto retry;
}
+ if ((cnp->cn_flags & ISLASTCN) &&
+ (cnp->cn_lkflags & LK_TYPE_MASK) == LK_EXCLUSIVE) {
+ ASSERT_VOP_ELOCKED(*vpp, "cache_lookup");
+ }
return (-1);
}