svn commit: r296717 - head/sys/kern

Edward Tomasz Napierala trasz at FreeBSD.org
Sat Mar 12 09:05:44 UTC 2016


Author: trasz
Date: Sat Mar 12 09:05:43 2016
New Revision: 296717
URL: https://svnweb.freebsd.org/changeset/base/296717

Log:
  Refactor the way we restore cn_lkflags; no functional changes.
  
  MFC after:	1 month
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==============================================================================
--- head/sys/kern/vfs_lookup.c	Sat Mar 12 08:50:38 2016	(r296716)
+++ head/sys/kern/vfs_lookup.c	Sat Mar 12 09:05:43 2016	(r296717)
@@ -726,8 +726,9 @@ unionlookup:
 	lkflags_save = cnp->cn_lkflags;
 	cnp->cn_lkflags = compute_cn_lkflags(dp->v_mount, cnp->cn_lkflags,
 	    cnp->cn_flags);
-	if ((error = VOP_LOOKUP(dp, &ndp->ni_vp, cnp)) != 0) {
-		cnp->cn_lkflags = lkflags_save;
+	error = VOP_LOOKUP(dp, &ndp->ni_vp, cnp);
+	cnp->cn_lkflags = lkflags_save;
+	if (error != 0) {
 		KASSERT(ndp->ni_vp == NULL, ("leaf should be empty"));
 #ifdef NAMEI_DIAGNOSTIC
 		printf("not found\n");
@@ -783,8 +784,7 @@ unionlookup:
 			VREF(ndp->ni_startdir);
 		}
 		goto success;
-	} else
-		cnp->cn_lkflags = lkflags_save;
+	}
 
 good:
 #ifdef NAMEI_DIAGNOSTIC


More information about the svn-src-head mailing list