summaryrefslogtreecommitdiffstats
path: root/include/linux/bitops_compat.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/bitops_compat.h')
-rw-r--r--include/linux/bitops_compat.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/include/linux/bitops_compat.h b/include/linux/bitops_compat.h
new file mode 100644
index 000000000..8e1e25809
--- /dev/null
+++ b/include/linux/bitops_compat.h
@@ -0,0 +1,19 @@
+#ifndef _SPL_BITOPS_COMPAT_H
+#define _SPL_BITOPS_COMPAT_H
+
+#include <linux/bitops.h>
+
+#ifndef HAVE_FLS64
+
+static inline int fls64(__u64 x)
+{
+ __u32 h = x >> 32;
+ if (h)
+ return fls(h) + 32;
+ return fls(x);
+}
+
+#endif /* HAVE_FLS64 */
+
+#endif /* _SPL_BITOPS_COMPAT_H */
+