Skip to content

Commit

Permalink
fs/mbcache: replace __builtin_log2() with ilog2()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
T Makphaibulchoke authored and Theodore Ts'o committed Jun 26, 2014
1 parent c5c7b8d commit ec7756a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/mbcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
#include <linux/mbcache.h>
#include <linux/init.h>
#include <linux/blockgroup_lock.h>
#include <linux/log2.h>

#ifdef MB_CACHE_DEBUG
# define mb_debug(f...) do { \
Expand All @@ -93,7 +94,7 @@

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

#define MB_CACHE_ENTRY_LOCK_BITS __builtin_log2(NR_BG_LOCKS)
#define MB_CACHE_ENTRY_LOCK_BITS ilog2(NR_BG_LOCKS)
#define MB_CACHE_ENTRY_LOCK_INDEX(ce) \
(hash_long((unsigned long)ce, MB_CACHE_ENTRY_LOCK_BITS))

Expand Down

0 comments on commit ec7756a

Please sign in to comment.