MCPcopy Create free account
hub / github.com/F-Stack/f-stack / space_available

Function space_available

freebsd/net/mp_ring.c:59–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57};
58
59static inline uint16_t
60space_available(struct ifmp_ring *r, union ring_state s)
61{
62 uint16_t x = r->size - 1;
63
64 if (s.cidx == s.pidx_head)
65 return (x);
66 else if (s.cidx > s.pidx_head)
67 return (s.cidx - s.pidx_head - 1);
68 else
69 return (x - s.pidx_head + s.cidx);
70}
71
72static inline uint16_t
73increment_idx(struct ifmp_ring *r, uint16_t idx, uint16_t n)

Callers 1

ifmp_ring_enqueueFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected