diff mbox

btrfs-progs: include kerncompat.h in raid6.c, define __attribute_const__

Message ID 510E9FA3.5060600@redhat.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Eric Sandeen Feb. 3, 2013, 5:34 p.m. UTC
raid6.c was failing to build for Goffredo and me due to
__attribute_const__ being undefined.

Define it in kerncompat.h and include that; this also makes
sure BITS_PER_LONG is defined for raid6.c, prior to this it 
was not defined, at least in my build.

Finally, redefine BITS_PER_LONG in a way that it can be
tested in the preprocessor macro.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---



--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Chris Mason Feb. 3, 2013, 5:41 p.m. UTC | #1
On Sun, Feb 03, 2013 at 10:34:27AM -0700, Eric Sandeen wrote:
> raid6.c was failing to build for Goffredo and me due to
> __attribute_const__ being undefined.

Thanks, I've pushed this along with an extra #ifndef into the raid56
experimental branch.

-chris
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/kerncompat.h b/kerncompat.h
index d60f722..1e7b7d3 100644
--- a/kerncompat.h
+++ b/kerncompat.h
@@ -36,7 +36,7 @@ 
 #define gfp_t int
 #define get_cpu_var(p) (p)
 #define __get_cpu_var(p) (p)
-#define BITS_PER_LONG (sizeof(long) * 8)
+#define BITS_PER_LONG (__SIZEOF_LONG__ * 8)
 #define __GFP_BITS_SHIFT 20
 #define __GFP_BITS_MASK ((int)((1 << __GFP_BITS_SHIFT) - 1))
 #define GFP_KERNEL 0
@@ -126,6 +126,8 @@  static inline int mutex_is_locked(struct mutex *m)
 #define BITOP_MASK(nr)		(1UL << ((nr) % BITS_PER_LONG))
 #define BITOP_WORD(nr)		((nr) / BITS_PER_LONG)
 
+#define __attribute_const__	__attribute__((__const__))
+
 /**
  * __set_bit - Set a bit in memory
  * @nr: the bit to set
diff --git a/raid6.c b/raid6.c
index 3a42bdf..ce0f655 100644
--- a/raid6.c
+++ b/raid6.c
@@ -19,6 +19,8 @@ 
  */
 #include <stdint.h>
 #include <unistd.h>
+#include "kerncompat.h"
+
 /*
  * This is the C data type to use
  */