Ⅰ.源碼
先給出find_next_bit的源碼(源碼來自內(nèi)核2.6.24,位置:/lib/find_next_bit.c)
1 unsigned long find_next_bit(const unsigned long *addr, unsigned long size, 2 unsigned long offset) 3 { 4 const unsigned long *p = addr + BITOP_WORD(offset); 5 unsigned long result = offset & ~(BITS_PER_LONG-1); 6 unsigned long tmp; 7 8 if (offset >= size) 9 return size;10 size -= result;11 offset %= BITS_PER_LONG;12 if (offset) {13 tmp = *(p++);14 tmp &= (~0UL << offset);15 if (size < BITS_PER_LONG)16 goto found_first;17 if (tmp)18 goto found_middle;19 size -= BITS_PER_LONG;20 result += BITS_PER_LON