diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-11-29 12:41:34 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2019-11-29 12:41:34 +0000 |
commit | 959ff3e5b9f971a145241ad3ca0fffb6e027ad3d (patch) | |
tree | ef1210b31e34bd567486a60c1407a458aacff37a | |
parent | f67b268725d23fd3229f73b136ba575514edf1a1 (diff) |
Use RW_PROC() consistently.
Suggested by and ok sashan@
-rw-r--r-- | sys/kern/kern_rwlock.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/kern/kern_rwlock.c b/sys/kern/kern_rwlock.c index d52349c100d..a78cba7b6d6 100644 --- a/sys/kern/kern_rwlock.c +++ b/sys/kern/kern_rwlock.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_rwlock.c,v 1.42 2019/11/16 16:21:10 visa Exp $ */ +/* $OpenBSD: kern_rwlock.c,v 1.43 2019/11/29 12:41:33 mpi Exp $ */ /* * Copyright (c) 2002, 2003 Artur Grabowski <art@openbsd.org> @@ -369,7 +369,7 @@ rw_assert_wrlock(struct rwlock *rwl) if (!(rwl->rwl_owner & RWLOCK_WRLOCK)) panic("%s: lock not held", rwl->rwl_name); - if (RWLOCK_OWNER(rwl) != (struct proc *)RW_PROC(curproc)) + if (RW_PROC(curproc) != RW_PROC(rwl->rwl_owner)) panic("%s: lock not held by this process", rwl->rwl_name); #endif } @@ -383,7 +383,7 @@ rw_assert_rdlock(struct rwlock *rwl) #ifdef WITNESS witness_assert(&rwl->rwl_lock_obj, LA_SLOCKED); #else - if (!RWLOCK_OWNER(rwl) || (rwl->rwl_owner & RWLOCK_WRLOCK)) + if (!RW_PROC(rwl->rwl_owner) || (rwl->rwl_owner & RWLOCK_WRLOCK)) panic("%s: lock not shared", rwl->rwl_name); #endif } @@ -436,8 +436,7 @@ rrw_enter(struct rrwlock *rrwl, int flags) { int rv; - if (RWLOCK_OWNER(&rrwl->rrwl_lock) == - (struct proc *)RW_PROC(curproc)) { + if (RW_PROC(rrwl->rrwl_lock.rwl_owner) == RW_PROC(curproc)) { if (flags & RW_RECURSEFAIL) return (EDEADLK); else { @@ -459,8 +458,7 @@ void rrw_exit(struct rrwlock *rrwl) { - if (RWLOCK_OWNER(&rrwl->rrwl_lock) == - (struct proc *)RW_PROC(curproc)) { + if (RW_PROC(rrwl->rrwl_lock.rwl_owner) == RW_PROC(curproc)) { KASSERT(rrwl->rrwl_wcnt > 0); rrwl->rrwl_wcnt--; if (rrwl->rrwl_wcnt != 0) { |