From ed633e0507226a7b807ae8d6659cba4cb2349e7b Mon Sep 17 00:00:00 2001 From: yangsheng Date: Fri, 11 Jun 2010 22:32:50 +0800 Subject: [PATCH] b=23039 Fix the build failed of sles9. i=johann --- lnet/include/libcfs/linux/libcfs.h | 2 +- lnet/include/libcfs/linux/linux-prim.h | 10 ++++++++++ lustre/include/liblustre.h | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lnet/include/libcfs/linux/libcfs.h b/lnet/include/libcfs/linux/libcfs.h index a5f0191..772b73a 100644 --- a/lnet/include/libcfs/linux/libcfs.h +++ b/lnet/include/libcfs/linux/libcfs.h @@ -50,8 +50,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/lnet/include/libcfs/linux/linux-prim.h b/lnet/include/libcfs/linux/linux-prim.h index 9f49543..5b53307 100644 --- a/lnet/include/libcfs/linux/linux-prim.h +++ b/lnet/include/libcfs/linux/linux-prim.h @@ -160,7 +160,17 @@ typedef long cfs_task_state_t; #define cfs_kthread_run(fn, data, fmt, arg...) kthread_run(fn, data, fmt, ##arg) #define cfs_cond_resched() cond_resched() + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12)) +/* cond_resched_lock() is bogus for kernels prior to 2.6.12, + * see bug 23039 */ +static inline int cfs_cond_resched_lock(cfs_spinlock_t *lock) +{ + return 0; +} +#else #define cfs_cond_resched_lock(lock) cond_resched_lock(lock) +#endif /* Kernel thread */ typedef int (*cfs_thread_t)(void *); diff --git a/lustre/include/liblustre.h b/lustre/include/liblustre.h index fc820e3..3e7fdea 100644 --- a/lustre/include/liblustre.h +++ b/lustre/include/liblustre.h @@ -306,6 +306,7 @@ extern int echo_client_init(void); struct rcu_head { }; typedef struct { } spinlock_t; +typedef spinlock_t cfs_spinlock_t; typedef __u64 kdev_t; #define SPIN_LOCK_UNLOCKED (spinlock_t) { } -- 1.8.3.1