svn commit: r333916 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Sun May 20 04:45:07 UTC 2018


Author: mjg
Date: Sun May 20 04:45:05 2018
New Revision: 333916
URL: https://svnweb.freebsd.org/changeset/base/333916

Log:
  vfs: simplify vop_stdlock/unlock
  
  The interlock pointer is non-NULL by definition and the compiler see through
  that and eliminates the NULL checks. Just remove them from the code as they
  play no role.
  
  No difference in generated assembly.

Modified:
  head/sys/kern/vfs_default.c

Modified: head/sys/kern/vfs_default.c
==============================================================================
--- head/sys/kern/vfs_default.c	Sun May 20 04:38:04 2018	(r333915)
+++ head/sys/kern/vfs_default.c	Sun May 20 04:45:05 2018	(r333916)
@@ -505,7 +505,7 @@ vop_stdlock(ap)
 
 	ilk = VI_MTX(vp);
 	return (lockmgr_lock_fast_path(vp->v_vnlock, ap->a_flags,
-	    (ilk != NULL) ? &ilk->lock_object : NULL, ap->a_file, ap->a_line));
+	    &ilk->lock_object, ap->a_file, ap->a_line));
 }
 
 /* See above. */
@@ -521,7 +521,7 @@ vop_stdunlock(ap)
 
 	ilk = VI_MTX(vp);
 	return (lockmgr_unlock_fast_path(vp->v_vnlock, ap->a_flags,
-	    (ilk != NULL) ? &ilk->lock_object : NULL));
+	    &ilk->lock_object));
 }
 
 /* See above. */


More information about the svn-src-all mailing list