rpms/kernel/devel linux-2.6-compile-fixes.patch,1.191,1.192

Chuck Ebbert cebbert at fedoraproject.org
Sun Feb 8 18:15:10 UTC 2009


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv24248

Modified Files:
	linux-2.6-compile-fixes.patch 
Log Message:
really fix btrfs build on ppc64

linux-2.6-compile-fixes.patch:

Index: linux-2.6-compile-fixes.patch
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/devel/linux-2.6-compile-fixes.patch,v
retrieving revision 1.191
retrieving revision 1.192
diff -u -r1.191 -r1.192
--- linux-2.6-compile-fixes.patch	8 Feb 2009 17:59:29 -0000	1.191
+++ linux-2.6-compile-fixes.patch	8 Feb 2009 18:15:10 -0000	1.192
@@ -4,23 +4,77 @@
 # Please add the errors from gcc before the diffs to save others having
 # to do a compile to figure out what your diff is fixing. Thanks.
 #
+From: Kyle McMartin <kyle at redhat.com>
 
+Architectures other than mips and x86 are not using ticket
+spinlocks. Therefore, the contention on the lock is meaningless,
+since there is nobody known to be waiting on it (arguably /fairly/
+unfair locks) Dummy it out to return 0 on other architectures.
+
+Signed-off-by: Kyle McMartin <kyle at redhat.com>
+---
+
+fixes:
   btrfs does not build on ppc64
   http://marc.info/?l=linux-kernel&m=123404002114219&w=2
   fs/btrfs/locking.c: In function 'btrfs_path_lock_waiting':
   fs/btrfs/locking.c:254: error: implicit declaration of function '__raw_spin_is_contended'
 
-Index: linux-2.6.28.noarch/fs/btrfs/locking.c
-===================================================================
---- linux-2.6.28.noarch.orig/fs/btrfs/locking.c
-+++ linux-2.6.28.noarch/fs/btrfs/locking.c
-@@ -241,6 +241,9 @@ int btrfs_tree_locked(struct extent_buff
-  * btrfs_search_slot uses this to decide if it should drop its locks
-  * before doing something expensive like allocating free blocks for cow.
-  */
-+#ifndef __raw_spin_is_contended
-+#define spin_is_contended(x) (0)
-+#endif
- int btrfs_path_lock_waiting(struct btrfs_path *path, int level)
+ arch/mips/include/asm/spinlock.h |    1 +
+ arch/x86/include/asm/paravirt.h  |    1 +
+ arch/x86/include/asm/spinlock.h  |    1 +
+ include/linux/spinlock.h         |    5 +++++
+ 4 files changed, 8 insertions(+), 0 deletions(-)
+diff --git a/arch/mips/include/asm/spinlock.h b/arch/mips/include/asm/spinlock.h
+index 1a1f320..0884947 100644
+--- a/arch/mips/include/asm/spinlock.h
++++ b/arch/mips/include/asm/spinlock.h
+@@ -51,6 +51,7 @@ static inline int __raw_spin_is_contended(raw_spinlock_t *lock)
+ 
+ 	return (((counters >> 14) - counters) & 0x1fff) > 1;
+ }
++#define __raw_spin_is_contended	__raw_spin_is_contended
+ 
+ static inline void __raw_spin_lock(raw_spinlock_t *lock)
+ {
+diff --git a/arch/x86/include/asm/paravirt.h b/arch/x86/include/asm/paravirt.h
+index ba3e2ff..c09a141 100644
+--- a/arch/x86/include/asm/paravirt.h
++++ b/arch/x86/include/asm/paravirt.h
+@@ -1402,6 +1402,7 @@ static inline int __raw_spin_is_contended(struct raw_spinlock *lock)
+ {
+ 	return PVOP_CALL1(int, pv_lock_ops.spin_is_contended, lock);
+ }
++#define __raw_spin_is_contended	__raw_spin_is_contended
+ 
+ static __always_inline void __raw_spin_lock(struct raw_spinlock *lock)
+ {
+diff --git a/arch/x86/include/asm/spinlock.h b/arch/x86/include/asm/spinlock.h
+index d17c919..8247e94 100644
+--- a/arch/x86/include/asm/spinlock.h
++++ b/arch/x86/include/asm/spinlock.h
+@@ -245,6 +245,7 @@ static inline int __raw_spin_is_contended(raw_spinlock_t *lock)
+ {
+ 	return __ticket_spin_is_contended(lock);
+ }
++#define __raw_spin_is_contended	__raw_spin_is_contended
+ 
+ static __always_inline void __raw_spin_lock(raw_spinlock_t *lock)
  {
- 	int i;
+diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
+index e0c0fcc..a0c66a2 100644
+--- a/include/linux/spinlock.h
++++ b/include/linux/spinlock.h
+@@ -124,7 +124,12 @@ do {								\
+ #ifdef CONFIG_GENERIC_LOCKBREAK
+ #define spin_is_contended(lock) ((lock)->break_lock)
+ #else
++
++#ifdef __raw_spin_is_contended
+ #define spin_is_contended(lock)	__raw_spin_is_contended(&(lock)->raw_lock)
++#else
++#define spin_is_contended(lock)	(((void)(lock), 0))
++#endif /*__raw_spin_is_contended*/
+ #endif
+ 
+ /**




More information about the scm-commits mailing list