From 5d3ff43a5c8b251a9dabb06a03783b1d53f516f6 Mon Sep 17 00:00:00 2001 From: "Luis R. Rodriguez" Date: Fri, 11 Dec 2009 15:36:16 -0800 Subject: [PATCH] Add a backport for flush_delayed_work() We can't really *flush* per se, see the code for more details but we can at least delete and synch the timer. Signed-off-by: Luis R. Rodriguez --- include/linux/compat-2.6.32.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/linux/compat-2.6.32.h b/include/linux/compat-2.6.32.h index 54f7cb09f575..727ac71d613e 100644 --- a/include/linux/compat-2.6.32.h +++ b/include/linux/compat-2.6.32.h @@ -9,6 +9,7 @@ #include #include #include +#include #define SDIO_VENDOR_ID_INTEL 0x0089 #define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX 0x1402 @@ -17,6 +18,24 @@ #define SDIO_DEVICE_ID_INTEL_IWMC3200GPS 0x1405 #define SDIO_DEVICE_ID_INTEL_IWMC3200BT 0x1406 +static inline void flush_delayed_work(struct delayed_work *dwork) +{ + if (del_timer_sync(&dwork->timer)) { + /* + * This is what would happen on 2.6.32 but since we don't have + * access to the singlethread_cpu we can't really backport this, + * so avoid really *flush*ing the work... Oh well. Any better ideas? + + struct cpu_workqueue_struct *cwq; + cwq = wq_per_cpu(keventd_wq, get_cpu()); + __queue_work(cwq, &dwork->work); + put_cpu(); + + */ + } + flush_work(&dwork->work); +} + /* * struct genl_multicast_group was made netns aware through * patch "genetlink: make netns aware" by johannes, we just -- 2.30.2