| 52 | } |
| 53 | |
| 54 | static __inline void |
| 55 | blockcount_acquire(blockcount_t *bc, u_int n) |
| 56 | { |
| 57 | #ifdef INVARIANTS |
| 58 | u_int old; |
| 59 | |
| 60 | old = atomic_fetchadd_int(&bc->__count, n); |
| 61 | KASSERT(old + n > old, ("%s: counter overflow %p", __func__, bc)); |
| 62 | #else |
| 63 | atomic_add_int(&bc->__count, n); |
| 64 | #endif |
| 65 | } |
| 66 | |
| 67 | static __inline void |
| 68 | blockcount_release(blockcount_t *bc, u_int n) |
no test coverage detected