summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2017-04-09 20:11:10 -0800
committerKent Overstreet <kent.overstreet@gmail.com>2017-04-09 20:12:37 -0800
commite783d814e83b2309930e1f6459212da6da8c8a54 (patch)
tree92c5b4b6e1c9e1e79db85470db934e34975e1c57 /include
parent2615d73a7428a08abdd058c875067847bf93d55c (diff)
Update bcachefs sources to da037866e6
Diffstat (limited to 'include')
-rw-r--r--include/linux/bitops.h25
-rw-r--r--include/linux/log2.h25
2 files changed, 25 insertions, 25 deletions
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index a0c6508c..47fffb79 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -247,29 +247,4 @@ unsigned long rounddown_pow_of_two(unsigned long n)
return 1UL << (fls_long(n) - 1);
}
-static inline __attribute_const__
-int __get_order(unsigned long size)
-{
- int order;
-
- size--;
- size >>= PAGE_SHIFT;
-#if BITS_PER_LONG == 32
- order = fls(size);
-#else
- order = fls64(size);
-#endif
- return order;
-}
-
-#define get_order(n) \
-( \
- __builtin_constant_p(n) ? ( \
- ((n) == 0UL) ? BITS_PER_LONG - PAGE_SHIFT : \
- (((n) < (1UL << PAGE_SHIFT)) ? 0 : \
- ilog2((n) - 1) - PAGE_SHIFT + 1) \
- ) : \
- __get_order(n) \
-)
-
#endif
diff --git a/include/linux/log2.h b/include/linux/log2.h
index 395cda29..6fecd393 100644
--- a/include/linux/log2.h
+++ b/include/linux/log2.h
@@ -184,4 +184,29 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
__rounddown_pow_of_two(n) \
)
+static inline __attribute_const__
+int __get_order(unsigned long size)
+{
+ int order;
+
+ size--;
+ size >>= PAGE_SHIFT;
+#if BITS_PER_LONG == 32
+ order = fls(size);
+#else
+ order = fls64(size);
+#endif
+ return order;
+}
+
+#define get_order(n) \
+( \
+ __builtin_constant_p(n) ? ( \
+ ((n) == 0UL) ? BITS_PER_LONG - PAGE_SHIFT : \
+ (((n) < (1UL << PAGE_SHIFT)) ? 0 : \
+ ilog2((n) - 1) - PAGE_SHIFT + 1) \
+ ) : \
+ __get_order(n) \
+)
+
#endif /* _TOOLS_LINUX_LOG2_H */