diff options
author | Mitchell Horne <mhorne@FreeBSD.org> | 2021-04-08 17:41:19 +0000 |
---|---|---|
committer | Mitchell Horne <mhorne@FreeBSD.org> | 2021-04-16 14:20:37 +0000 |
commit | 67bf33e04652b6dd1a948c8b93bb6bebbb1519d5 (patch) | |
tree | 9087d2aedba2fd028bd96fd2a5a6e80f158aeab6 /sys/kern/kern_rmlock.c | |
parent | a83c64a59cf5dd4c8eb86ce9dbdcf84c2c874fb8 (diff) | |
download | src-67bf33e04652b6dd1a948c8b93bb6bebbb1519d5.tar.gz src-67bf33e04652b6dd1a948c8b93bb6bebbb1519d5.zip |
rmlock(9): add an RM_DUPOK flag
Allows for duplicate locks to be acquired without witness complaining.
Similar flags exists already for rwlock(9) and sx(9).
Reviewed by: markj
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
(cherry picked from commit 2816bd8442bc323d50434d0e64cb4b7c10a195e8)
Diffstat (limited to 'sys/kern/kern_rmlock.c')
-rw-r--r-- | sys/kern/kern_rmlock.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_rmlock.c b/sys/kern/kern_rmlock.c index de2a5818c5bf..585ccce6d2a4 100644 --- a/sys/kern/kern_rmlock.c +++ b/sys/kern/kern_rmlock.c @@ -288,6 +288,8 @@ rm_init_flags(struct rmlock *rm, const char *name, int opts) liflags |= LO_RECURSABLE; if (opts & RM_NEW) liflags |= LO_NEW; + if (opts & RM_DUPOK) + liflags |= LO_DUPOK; rm->rm_writecpus = all_cpus; LIST_INIT(&rm->rm_activeReaders); if (opts & RM_SLEEPABLE) { |