From 1943938a05defea7c09469b3c4c6ce6634f37fe8 Mon Sep 17 00:00:00 2001 From: wangdi Date: Thu, 23 Oct 2003 14:00:47 +0000 Subject: [PATCH] a better way to fix the build error for work_struct in 2.6 --- lnet/include/linux/kp30.h | 3 +++ lnet/router/router.h | 6 +----- lustre/portals/include/linux/kp30.h | 3 +++ lustre/portals/router/router.h | 6 +----- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lnet/include/linux/kp30.h b/lnet/include/linux/kp30.h index 94b61e0..aef9522 100644 --- a/lnet/include/linux/kp30.h +++ b/lnet/include/linux/kp30.h @@ -188,6 +188,7 @@ static inline void our_cond_resched(void) if (current->need_resched) schedule (); } +#define work_struct_t struct tq_struct #else @@ -203,6 +204,8 @@ static inline void our_cond_resched(void) { cond_resched(); } +#define work_struct_t struct work_struct + #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) */ #ifdef PORTAL_DEBUG diff --git a/lnet/router/router.h b/lnet/router/router.h index 4ace247..ea25439 100644 --- a/lnet/router/router.h +++ b/lnet/router/router.h @@ -71,11 +71,7 @@ typedef struct typedef struct { -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) - struct work_struct kpru_tq; -#else - struct tq_struct kpru_tq; -#endif + work_struct_t kpru_tq; int kpru_nal_id; ptl_nid_t kpru_nid; int kpru_alive; diff --git a/lustre/portals/include/linux/kp30.h b/lustre/portals/include/linux/kp30.h index 94b61e0..aef9522 100644 --- a/lustre/portals/include/linux/kp30.h +++ b/lustre/portals/include/linux/kp30.h @@ -188,6 +188,7 @@ static inline void our_cond_resched(void) if (current->need_resched) schedule (); } +#define work_struct_t struct tq_struct #else @@ -203,6 +204,8 @@ static inline void our_cond_resched(void) { cond_resched(); } +#define work_struct_t struct work_struct + #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0) */ #ifdef PORTAL_DEBUG diff --git a/lustre/portals/router/router.h b/lustre/portals/router/router.h index 4ace247..ea25439 100644 --- a/lustre/portals/router/router.h +++ b/lustre/portals/router/router.h @@ -71,11 +71,7 @@ typedef struct typedef struct { -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) - struct work_struct kpru_tq; -#else - struct tq_struct kpru_tq; -#endif + work_struct_t kpru_tq; int kpru_nal_id; ptl_nid_t kpru_nid; int kpru_alive; -- 1.8.3.1