33 #include <linux/kernel.h>
68 memset(ring, 0,
sizeof(*ring));
70 rdsdebug(
"ring %p nr %u\n", ring, ring->
w_nr);
88 BUG_ON(__rds_iw_ring_used(ring));
94 return __rds_iw_ring_used(ring) == 0;
101 avail = ring->
w_nr - __rds_iw_ring_used(ring);
103 rdsdebug(
"ring %p val %u next %u free %u\n", ring, val,
122 if (__rds_iw_ring_empty(ring) &&
135 return __rds_iw_ring_empty(ring);
140 return __rds_iw_ring_used(ring) <= (ring->
w_nr >> 1);
161 if (oldest <= (
unsigned long long)wr_id)
162 ret = (
unsigned long long)wr_id - oldest + 1;
164 ret = ring->
w_nr - oldest + (
unsigned long long)wr_id + 1;
166 rdsdebug(
"ring %p ret %u wr_id %u oldest %u\n", ring, ret,