From 7fe7405277a95f35cc549149765960ef548a5c35 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Fri, 6 May 2016 02:20:41 +0000 Subject: [PATCH] cleanup: remove support of old kernels without cancel_delayed_work_sync Otherwise we can not use scst_mutex on works git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6887 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/backport.h | 31 ------------------------------- scst/src/scst_main.c | 5 ----- 2 files changed, 36 deletions(-) diff --git a/scst/include/backport.h b/scst/include/backport.h index 61c5e9864..8e1a6afa0 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -631,37 +631,6 @@ static inline void *vzalloc(unsigned long size) } #endif -/* */ - -#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) -{ - int res; - - res = cancel_delayed_work(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 - /* */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 8aeee5342..3ff5419c7 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -64,11 +64,6 @@ Pass-through dev handlers will not work. /* * Main SCST mutex. All targets, devices and dev_types management is done * under this mutex. - * - * It must NOT be used in any works (schedule_work(), etc.), because - * otherwise a deadlock (double lock, actually) is possible, e.g., with - * scst_user detach_tgt(), which is called under scst_mutex and calls - * flush_scheduled_work(). */ struct mutex scst_mutex; EXPORT_SYMBOL_GPL(scst_mutex);