Skip to content

Commit ec7756a

Browse files
T Makphaibulchoketytso
authored andcommitted
fs/mbcache: replace __builtin_log2() with ilog2()
Fix compiler error with some gcc version(s) that do not support __builtin_log2() by replacing __builtin_log2() with ilog2(). Signed-off-by: T. Makphaibulchoke <tmac@hp.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Reviewed-by: Maciej W. Rozycki <macro@linux-mips.org>
1 parent c5c7b8d commit ec7756a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎fs/mbcache.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
#include <linux/mbcache.h>
7474
#include <linux/init.h>
7575
#include <linux/blockgroup_lock.h>
76+
#include <linux/log2.h>
7677

7778
#ifdef MB_CACHE_DEBUG
7879
# define mb_debug(f...) do { \
@@ -93,7 +94,7 @@
9394

9495
#define MB_CACHE_WRITER ((unsigned short)~0U >> 1)
9596

96-
#define MB_CACHE_ENTRY_LOCK_BITS __builtin_log2(NR_BG_LOCKS)
97+
#define MB_CACHE_ENTRY_LOCK_BITS ilog2(NR_BG_LOCKS)
9798
#define MB_CACHE_ENTRY_LOCK_INDEX(ce) \
9899
(hash_long((unsigned long)ce, MB_CACHE_ENTRY_LOCK_BITS))
99100

0 commit comments

Comments
 (0)