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

Function generic_bitpos

freebsd/kern/subr_blist.c:190–205  ·  view source on GitHub ↗

* Find the first bit set in a u_daddr_t. */

Source from the content-addressed store, hash-verified

188 * Find the first bit set in a u_daddr_t.
189 */
190static inline int
191generic_bitpos(u_daddr_t mask)
192{
193 int hi, lo, mid;
194
195 lo = 0;
196 hi = BLIST_RADIX;
197 while (lo + 1 < hi) {
198 mid = (lo + hi) >> 1;
199 if (mask & bitrange(0, mid))
200 hi = mid;
201 else
202 lo = mid;
203 }
204 return (lo);
205}
206
207static inline int
208bitpos(u_daddr_t mask)

Callers 1

bitposFunction · 0.85

Calls 1

bitrangeFunction · 0.85

Tested by

no test coverage detected