diff options
author | 2018-06-04 04:46:07 +0000 | |
---|---|---|
committer | 2018-06-04 04:46:07 +0000 | |
commit | 3bc9e445d10d08c0183fa7992e5cbdd3641ef899 (patch) | |
tree | ecb00beb04e50f082770a52c0ce49338d59ad812 /sys/kern/kern_rwlock.c | |
parent | Use variable names for rtable and rdomain consistently in the in_pcb (diff) | |
download | wireguard-openbsd-3bc9e445d10d08c0183fa7992e5cbdd3641ef899.tar.xz wireguard-openbsd-3bc9e445d10d08c0183fa7992e5cbdd3641ef899.zip |
Add RW_DUPOK for suppressing witness checks for specific rw_enter() calls
ok deraadt@ visa@
Diffstat (limited to 'sys/kern/kern_rwlock.c')
-rw-r--r-- | sys/kern/kern_rwlock.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c index d24bb6c8734..97e22a5e966 100644 --- a/sys/kern/kern_rwlock.c +++ b/sys/kern/kern_rwlock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_rwlock.c,v 1.35 2018/03/21 12:28:39 bluhm Exp $ */ +/* $OpenBSD: kern_rwlock.c,v 1.36 2018/06/04 04:46:07 guenther Exp $ */ /* * Copyright (c) 2002, 2003 Artur Grabowski <art@openbsd.org> @@ -223,6 +223,8 @@ _rw_enter(struct rwlock *rwl, int flags LOCK_FL_VARS) lop_flags = LOP_NEWORDER; if (flags & RW_WRITE) lop_flags |= LOP_EXCLUSIVE; + if (flags & RW_DUPOK) + lop_flags |= LOP_DUPOK; if ((flags & RW_NOSLEEP) == 0 && (flags & RW_DOWNGRADE) == 0) WITNESS_CHECKORDER(&rwl->rwl_lock_obj, lop_flags, file, line, NULL); |