]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - include/linux/kernel.h
New upstream release
[bcachefs-tools-debian] / include / linux / kernel.h
index b2c1751c56e2fcdffb87d7ef34c49571a0f11e36..35a7207e0495c08d950a991abbebebdf03b9a782 100644 (file)
@@ -13,6 +13,9 @@
 #include <linux/compiler.h>
 #include <linux/math.h>
 
+#define BIT(nr)                        (1UL << (nr))
+#define BIT_ULL(nr)            (1ULL << (nr))
+
 #define __ARG_PLACEHOLDER_1 0,
 #define __take_second_arg(__ignored, val, ...) val
 
        (type *)((char *)__mptr - offsetof(type, member)); })
 #endif
 
+#define __struct_group(TAG, NAME, ATTRS, MEMBERS...) \
+       union { \
+               struct { MEMBERS } ATTRS; \
+               struct TAG { MEMBERS } ATTRS NAME; \
+       }
+#define struct_group(NAME, MEMBERS...) \
+       __struct_group(/* no tag */, NAME, /* no attrs */, MEMBERS)
+
 #define max(x, y) ({                           \
        typeof(x) _max1 = (x);                  \
        typeof(y) _max2 = (y);                  \
 
 #define might_sleep()
 
-#define cpu_relax()            do {} while (0)
-#define cpu_relax_lowlatency() do {} while (0)
+#define cpu_relax()            barrier()
+#define cpu_relax_lowlatency() barrier()
 
 #define panic(fmt, ...)                                        \
 do {                                                   \
@@ -264,4 +275,7 @@ struct qstr {
 
 static inline void dump_stack(void) {}
 
+#define unsafe_memcpy(dst, src, bytes, justification)          \
+       memcpy(dst, src, bytes)
+
 #endif