svn commit: r325963 - head/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Fri Nov 17 23:27:07 UTC 2017


Author: mjg
Date: Fri Nov 17 23:27:06 2017
New Revision: 325963
URL: https://svnweb.freebsd.org/changeset/base/325963

Log:
  locks: fix compilation issues without SMP or KDTRACE_HOOKS

Modified:
  head/sys/kern/kern_mutex.c
  head/sys/kern/kern_sx.c

Modified: head/sys/kern/kern_mutex.c
==============================================================================
--- head/sys/kern/kern_mutex.c	Fri Nov 17 23:25:06 2017	(r325962)
+++ head/sys/kern/kern_mutex.c	Fri Nov 17 23:27:06 2017	(r325963)
@@ -462,9 +462,7 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v)
 	struct mtx *m;
 	struct turnstile *ts;
 	uintptr_t tid;
-#ifdef ADAPTIVE_MUTEXES
 	struct thread *owner;
-#endif
 #ifdef KTR
 	int cont_logged = 0;
 #endif
@@ -628,6 +626,9 @@ __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t v)
 		 */
 #ifdef KDTRACE_HOOKS
 		sleep_time -= lockstat_nsecs(&m->lock_object);
+#endif
+#ifndef ADAPTIVE_MUTEXES
+		owner = mtx_owner(m);
 #endif
 		MPASS(owner == mtx_owner(m));
 		turnstile_wait(ts, owner, TS_EXCLUSIVE_QUEUE);

Modified: head/sys/kern/kern_sx.c
==============================================================================
--- head/sys/kern/kern_sx.c	Fri Nov 17 23:25:06 2017	(r325962)
+++ head/sys/kern/kern_sx.c	Fri Nov 17 23:27:06 2017	(r325963)
@@ -520,8 +520,8 @@ _sx_xlock_hard(struct sx *sx, uintptr_t x, uintptr_t t
 #endif
 #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
 	uintptr_t state;
-	int extra_work;
 #endif
+	int extra_work = 0;
 
 	if (SCHEDULER_STOPPED())
 		return (0);
@@ -880,8 +880,8 @@ _sx_slock_hard(struct sx *sx, int opts, const char *fi
 #endif
 #if defined(KDTRACE_HOOKS) || defined(LOCK_PROFILING)
 	uintptr_t state;
-	int extra_work;
 #endif
+	int extra_work = 0;
 
 	if (SCHEDULER_STOPPED())
 		return (0);


More information about the svn-src-all mailing list