d_path: Use struct path in struct avc_audit_data
[sfrench/cifs-2.6.git] / include / linux / bitops.h
index 638165f571dacedf7455f0bc9d87e3390b8ee781..69c1edb9fe54a345f061cf983fe8311805c83154 100644 (file)
@@ -2,12 +2,26 @@
 #define _LINUX_BITOPS_H
 #include <asm/types.h>
 
+#ifdef __KERNEL__
+#define BIT(nr)                        (1UL << (nr))
+#define BIT_MASK(nr)           (1UL << ((nr) % BITS_PER_LONG))
+#define BIT_WORD(nr)           ((nr) / BITS_PER_LONG)
+#define BITS_TO_LONGS(nr)      DIV_ROUND_UP(nr, BITS_PER_LONG)
+#define BITS_PER_BYTE          8
+#endif
+
 /*
  * Include this here because some architectures need generic_ffs/fls in
  * scope
  */
 #include <asm/bitops.h>
 
+#define for_each_bit(bit, addr, size) \
+       for ((bit) = find_first_bit((addr), (size)); \
+            (bit) < (size); \
+            (bit) = find_next_bit((addr), (size), (bit) + 1))
+
+
 static __inline__ int get_bitmask_order(unsigned int count)
 {
        int order;