Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 May 2018 04:45:06 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r333916 - head/sys/kern
Message-ID:  <201805200445.w4K4j66n078040@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805200445.w4K4j66n078040>