Module Name:    src
Committed By:   jakllsch
Date:           Mon Sep 18 13:22:56 UTC 2017

Modified Files:
        src/sys/kern: subr_extent.c

Log Message:
Initialize ex_lock and ex_cv only in the not-EX_EARLY case.


To generate a diff of this commit:
cvs rdiff -u -r1.84 -r1.85 src/sys/kern/subr_extent.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/subr_extent.c
diff -u src/sys/kern/subr_extent.c:1.84 src/sys/kern/subr_extent.c:1.85
--- src/sys/kern/subr_extent.c:1.84	Thu Aug 24 17:18:55 2017
+++ src/sys/kern/subr_extent.c	Mon Sep 18 13:22:56 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: subr_extent.c,v 1.84 2017/08/24 17:18:55 kre Exp $	*/
+/*	$NetBSD: subr_extent.c,v 1.85 2017/09/18 13:22:56 jakllsch Exp $	*/
 
 /*-
  * Copyright (c) 1996, 1998, 2007 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_extent.c,v 1.84 2017/08/24 17:18:55 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_extent.c,v 1.85 2017/09/18 13:22:56 jakllsch Exp $");
 
 #ifdef _KERNEL
 #ifdef _KERNEL_OPT
@@ -295,8 +295,10 @@ extent_create(const char *name, u_long s
 	}
 
 	/* Fill in the extent descriptor and return it to the caller. */
-	mutex_init(&ex->ex_lock, MUTEX_DEFAULT, IPL_VM);
-	cv_init(&ex->ex_cv, "extent");
+	if ((flags & EX_EARLY) == 0) {
+		mutex_init(&ex->ex_lock, MUTEX_DEFAULT, IPL_VM);
+		cv_init(&ex->ex_cv, "extent");
+	}
 	LIST_INIT(&ex->ex_regions);
 	ex->ex_name = name;
 	ex->ex_start = start;

Reply via email to