| 1018 | } |
| 1019 | |
| 1020 | void |
| 1021 | rms_rlock(struct rmslock *rms) |
| 1022 | { |
| 1023 | struct rmslock_pcpu *pcpu; |
| 1024 | |
| 1025 | WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, __func__); |
| 1026 | MPASS(atomic_load_ptr(&rms->owner) != curthread); |
| 1027 | |
| 1028 | critical_enter(); |
| 1029 | pcpu = rms_int_pcpu(rms); |
| 1030 | rms_int_influx_enter(rms, pcpu); |
| 1031 | atomic_interrupt_fence(); |
| 1032 | if (__predict_false(rms->writers > 0)) { |
| 1033 | rms_rlock_fallback(rms); |
| 1034 | return; |
| 1035 | } |
| 1036 | atomic_interrupt_fence(); |
| 1037 | rms_int_readers_inc(rms, pcpu); |
| 1038 | atomic_interrupt_fence(); |
| 1039 | rms_int_influx_exit(rms, pcpu); |
| 1040 | critical_exit(); |
| 1041 | } |
| 1042 | |
| 1043 | int |
| 1044 | rms_try_rlock(struct rmslock *rms) |
no test coverage detected