Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jan 2019 00:35:20 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r343027 - in head/sys: kern sys
Message-ID:  <201901150035.x0F0ZK6d009893@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Tue Jan 15 00:35:19 2019
New Revision: 343027
URL: https://svnweb.freebsd.org/changeset/base/343027

Log:
  Add flag LK_NEW for lockinit() that is converted to LO_NEW and passed
  down to lock_init().  This allows for lockinit() on a not prezeroed
  memory.

Modified:
  head/sys/kern/kern_lock.c
  head/sys/sys/lockmgr.h

Modified: head/sys/kern/kern_lock.c
==============================================================================
--- head/sys/kern/kern_lock.c	Tue Jan 15 00:02:06 2019	(r343026)
+++ head/sys/kern/kern_lock.c	Tue Jan 15 00:35:19 2019	(r343027)
@@ -450,6 +450,8 @@ lockinit(struct lock *lk, int pri, const char *wmesg, 
 		iflags |= LO_QUIET;
 	if (flags & LK_IS_VNODE)
 		iflags |= LO_IS_VNODE;
+	if (flags & LK_NEW)
+		iflags |= LO_NEW;
 	iflags |= flags & (LK_ADAPTIVE | LK_NOSHARE);
 
 	lock_init(&lk->lock_object, &lock_class_lockmgr, wmesg, NULL, iflags);

Modified: head/sys/sys/lockmgr.h
==============================================================================
--- head/sys/sys/lockmgr.h	Tue Jan 15 00:02:06 2019	(r343026)
+++ head/sys/sys/lockmgr.h	Tue Jan 15 00:35:19 2019	(r343027)
@@ -143,7 +143,7 @@ _lockmgr_args_rw(struct lock *lk, u_int flags, struct 
 /*
  * Flags for lockinit().
  */
-#define	LK_INIT_MASK	0x0000FF
+#define	LK_INIT_MASK	0x0001FF
 #define	LK_CANRECURSE	0x000001
 #define	LK_NODUP	0x000002
 #define	LK_NOPROFILE	0x000004
@@ -152,6 +152,7 @@ _lockmgr_args_rw(struct lock *lk, u_int flags, struct 
 #define	LK_QUIET	0x000020
 #define	LK_ADAPTIVE	0x000040
 #define	LK_IS_VNODE	0x000080	/* Tell WITNESS about a VNODE lock */
+#define	LK_NEW		0x000100
 
 /*
  * Additional attributes to be used in lockmgr().



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