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.
This commit is contained in:
Gleb Smirnoff 2019-01-15 00:35:19 +00:00
parent bb15d1c778
commit 46713135ae
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=343027
2 changed files with 4 additions and 1 deletions

View File

@ -450,6 +450,8 @@ lockinit(struct lock *lk, int pri, const char *wmesg, int timo, int flags)
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);

View File

@ -143,7 +143,7 @@ _lockmgr_args_rw(struct lock *lk, u_int flags, struct rwlock *ilk,
/*
* 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 rwlock *ilk,
#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().