aboutsummaryrefslogtreecommitdiffstats
path: root/include/sys/rwlock.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sys/rwlock.h')
-rw-r--r--include/sys/rwlock.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/include/sys/rwlock.h b/include/sys/rwlock.h
index 14d097b01..facebe3ba 100644
--- a/include/sys/rwlock.h
+++ b/include/sys/rwlock.h
@@ -223,13 +223,10 @@ RW_LOCK_HELD(krwlock_t *rwp)
if (RW_WRITE_HELD(rwp)) { \
_rc_ = 1; \
} else { \
- rw_exit(rwp); \
- if (rw_tryenter(rwp, RW_WRITER)) { \
- _rc_ = 1; \
- } else { \
- rw_enter(rwp, RW_READER); \
- _rc_ = 0; \
- } \
+ spl_rw_lockdep_off_maybe(rwp); \
+ if ((_rc_ = rwsem_tryupgrade(SEM(rwp)))) \
+ spl_rw_set_owner(rwp); \
+ spl_rw_lockdep_on_maybe(rwp); \
} \
_rc_; \
})