| 1041 | } |
| 1042 | |
| 1043 | int |
| 1044 | rms_try_rlock(struct rmslock *rms) |
| 1045 | { |
| 1046 | struct rmslock_pcpu *pcpu; |
| 1047 | |
| 1048 | MPASS(atomic_load_ptr(&rms->owner) != curthread); |
| 1049 | |
| 1050 | critical_enter(); |
| 1051 | pcpu = rms_int_pcpu(rms); |
| 1052 | rms_int_influx_enter(rms, pcpu); |
| 1053 | atomic_interrupt_fence(); |
| 1054 | if (__predict_false(rms->writers > 0)) { |
| 1055 | rms_int_influx_exit(rms, pcpu); |
| 1056 | critical_exit(); |
| 1057 | return (0); |
| 1058 | } |
| 1059 | atomic_interrupt_fence(); |
| 1060 | rms_int_readers_inc(rms, pcpu); |
| 1061 | atomic_interrupt_fence(); |
| 1062 | rms_int_influx_exit(rms, pcpu); |
| 1063 | critical_exit(); |
| 1064 | return (1); |
| 1065 | } |
| 1066 | |
| 1067 | static void __noinline |
| 1068 | rms_runlock_fallback(struct rmslock *rms) |
nothing calls this directly
no test coverage detected