Go to the documentation of this file.
12 #include <linux/bitops.h>
13 #include <linux/export.h>
14 #include <asm/types.h>
15 #include <asm/byteorder.h>
17 #define BITOP_WORD(nr) ((nr) / BITS_PER_LONG)
59 return result +
__ffs(tmp);
64 #ifndef find_next_zero_bit
103 return result +
size;
105 return result +
ffz(tmp);
110 #ifndef find_first_bit
116 const unsigned long *
p =
addr;
131 return result +
size;
133 return result +
__ffs(tmp);
138 #ifndef find_first_zero_bit
144 const unsigned long *
p =
addr;
157 tmp = (*p) | (~0
UL <<
size);
159 return result +
size;
161 return result +
ffz(tmp);
169 static inline unsigned long ext2_swabp(
const unsigned long *
x)
171 #if BITS_PER_LONG == 64
172 return (
unsigned long) __swab64p((
u64 *) x);
173 #elif BITS_PER_LONG == 32
174 return (
unsigned long) __swab32p((
u32 *) x);
176 #error BITS_PER_LONG not defined
181 static inline unsigned long ext2_swab(
const unsigned long y)
183 #if BITS_PER_LONG == 64
185 #elif BITS_PER_LONG == 32
188 #error BITS_PER_LONG not defined
192 #ifndef find_next_zero_bit_le
196 const unsigned long *
p =
addr;
206 tmp = ext2_swabp(p++);
218 goto found_middle_swap;
228 return result +
size;
230 return result +
ffz(tmp);
233 return result +
ffz(ext2_swab(tmp));
238 #ifndef find_next_bit_le
240 long size,
unsigned long offset)
242 const unsigned long *p =
addr;
252 tmp = ext2_swabp(p++);
265 goto found_middle_swap;
275 return result +
size;
277 return result +
__ffs(tmp);
280 return result +
__ffs(ext2_swab(tmp));