add patch create-function-to-read-journal-inode
[ext4-patch-queue.git] / replace-builtin_log-with-ilog2
blobb855ee15a1138f64276256f864a31a7356d53df8
1 fs/mbcache: replace __builtin_log2() with ilog2()
3 From: T Makphaibulchoke <tmac@hp.com>
5 Fix compiler error with some gcc version(s) that do not
6 support __builtin_log2() by replacing __builtin_log2() with
7 ilog2().
9 Signed-off-by: T. Makphaibulchoke <tmac@hp.com>
10 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 Reviewed-by: Maciej W. Rozycki <macro@linux-mips.org>
12 ---
13  fs/mbcache.c | 3 ++-
14  1 file changed, 2 insertions(+), 1 deletion(-)
16 diff --git a/fs/mbcache.c b/fs/mbcache.c
17 index bf166e3..187477d 100644
18 --- a/fs/mbcache.c
19 +++ b/fs/mbcache.c
20 @@ -73,6 +73,7 @@
21  #include <linux/mbcache.h>
22  #include <linux/init.h>
23  #include <linux/blockgroup_lock.h>
24 +#include <linux/log2.h>
26  #ifdef MB_CACHE_DEBUG
27  # define mb_debug(f...) do { \
28 @@ -93,7 +94,7 @@
30  #define MB_CACHE_WRITER ((unsigned short)~0U >> 1)
32 -#define MB_CACHE_ENTRY_LOCK_BITS       __builtin_log2(NR_BG_LOCKS)
33 +#define MB_CACHE_ENTRY_LOCK_BITS       ilog2(NR_BG_LOCKS)
34  #define        MB_CACHE_ENTRY_LOCK_INDEX(ce)                   \
35         (hash_long((unsigned long)ce, MB_CACHE_ENTRY_LOCK_BITS))
37 -- 
38 1.7.11.3