Author: mjg
Date: Wed Nov 30 02:14:53 2016
New Revision: 309307
URL: https://svnweb.freebsd.org/changeset/base/309307

Log:
  vfs: avoid VOP_ISLOCKED in the common case in lookup

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==============================================================================
--- head/sys/kern/vfs_lookup.c  Wed Nov 30 02:00:30 2016        (r309306)
+++ head/sys/kern/vfs_lookup.c  Wed Nov 30 02:14:53 2016        (r309307)
@@ -807,10 +807,9 @@ 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))
-               vn_lock(dp, LK_UPGRADE|LK_RETRY);
+       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;
                goto bad;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to