From f38c76b29a7b33079f2edc008dcc54d8bed591a6 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Wed, 25 Jun 2014 22:15:29 -0400 Subject: [PATCH] add patch replace-builtin_log-with-ilog2 --- replace-builtin_log-with-ilog2 | 40 ++++++++++++++++++++++++++++++++++++++++ series | 1 + 2 files changed, 41 insertions(+) create mode 100644 replace-builtin_log-with-ilog2 diff --git a/replace-builtin_log-with-ilog2 b/replace-builtin_log-with-ilog2 new file mode 100644 index 00000000..b855ee15 --- /dev/null +++ b/replace-builtin_log-with-ilog2 @@ -0,0 +1,40 @@ +fs/mbcache: replace __builtin_log2() with ilog2() + +From: T Makphaibulchoke + +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 +Signed-off-by: Theodore Ts'o +Reviewed-by: Maciej W. Rozycki +--- + fs/mbcache.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/fs/mbcache.c b/fs/mbcache.c +index bf166e3..187477d 100644 +--- a/fs/mbcache.c ++++ b/fs/mbcache.c +@@ -73,6 +73,7 @@ + #include + #include + #include ++#include + + #ifdef MB_CACHE_DEBUG + # define mb_debug(f...) do { \ +@@ -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)) + +-- +1.7.11.3 + + diff --git a/series b/series index 3ffb0fb7..fc529450 100644 --- a/series +++ b/series @@ -1,6 +1,7 @@ # BASE f8409abdc592e fix-buffer-double-free-in-ext4_alloc_branch +replace-builtin_log-with-ilog2 fix-32bit-breakage-in-block-device remove-metadata-reservation-checks -- 2.11.4.GIT