From e7ccb782724d8e6f65f3bffd6fef3d7a8fcbd552 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sat, 3 Nov 2012 19:37:37 +0000 Subject: [PATCH] RHEL 5.6 build fix (merge r3408 from trunk). git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@4599 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/scst/include/scst.h b/scst/include/scst.h index 028077333..e7f9d83ec 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -3853,9 +3853,6 @@ void scst_put_buf_full(struct scst_cmd *cmd, uint8_t *buf); #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) && !defined(BACKPORT_LINUX_WORKQUEUE_TO_2_6_19) #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)) static inline int cancel_delayed_work_sync(struct delayed_work *work) -#else -static inline int cancel_delayed_work_sync(struct work_struct *work) -#endif { int res; @@ -3863,6 +3860,23 @@ static inline int cancel_delayed_work_sync(struct work_struct *work) flush_scheduled_work(); return res; } +#else +/* + * While cancel_delayed_work_sync() has not been defined in the vanilla kernel + * 2.6.18 nor in 2.6.19 nor in RHEL/CentOS 5.0..5.5, a definition is available + * in RHEL/CentOS 5.6. Unfortunately that definition is incompatible with what + * we need. So define cancel_delayed_work() as a macro such that it overrides + * the RHEL/CentOS 5.6 inline function definition in . + */ +#define cancel_delayed_work_sync(work) \ +({ \ + int res; \ + \ + res = cancel_delayed_work((work)); \ + flush_scheduled_work(); \ + res; \ +}) +#endif #endif #ifdef CONFIG_DEBUG_LOCK_ALLOC