| 85 | } |
| 86 | |
| 87 | static __inline u_int |
| 88 | refcount_acquiren(volatile u_int *count, u_int n) |
| 89 | { |
| 90 | u_int old; |
| 91 | |
| 92 | KASSERT(n < REFCOUNT_SATURATION_VALUE / 2, |
| 93 | ("refcount_acquiren: n=%u too large", n)); |
| 94 | old = atomic_fetchadd_int(count, n); |
| 95 | if (__predict_false(REFCOUNT_SATURATED(old))) |
| 96 | _refcount_update_saturated(count); |
| 97 | |
| 98 | return (old); |
| 99 | } |
| 100 | |
| 101 | static __inline __result_use_check bool |
| 102 | refcount_acquire_checked(volatile u_int *count) |
nothing calls this directly
no test coverage detected