summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormjg <mjg@FreeBSD.org>2016-12-31 13:10:08 +0000
committermjg <mjg@FreeBSD.org>2016-12-31 13:10:08 +0000
commita1a1877db83d7c5aa4ce309712bbc253b1802cff (patch)
treeead02f4df20fde4f83ab9ab053befcbbbe2904aa
parentd105a8765c1bdb35687287537bbae5ef94a663a7 (diff)
downloadFreeBSD-src-a1a1877db83d7c5aa4ce309712bbc253b1802cff.zip
FreeBSD-src-a1a1877db83d7c5aa4ce309712bbc253b1802cff.tar.gz
MFC r309307,r309308:
vfs: avoid VOP_ISLOCKED in the common case in lookup == vfs: fix a whitespace nit in r309307
-rw-r--r--sys/kern/vfs_lookup.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index 0fff629..e8a2c83 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -802,9 +802,8 @@ unionlookup:
* If we have a shared lock we may need to upgrade the lock for the
* last operation.
*/
- if (dp != vp_crossmp &&
- VOP_ISLOCKED(dp) == LK_SHARED &&
- (cnp->cn_flags & ISLASTCN) && (cnp->cn_flags & LOCKPARENT))
+ if ((cnp->cn_flags & LOCKPARENT) && (cnp->cn_flags & ISLASTCN) &&
+ dp != vp_crossmp && VOP_ISLOCKED(dp) == LK_SHARED)
vn_lock(dp, LK_UPGRADE|LK_RETRY);
if ((dp->v_iflag & VI_DOOMED) != 0) {
error = ENOENT;
OpenPOWER on IntegriCloud