From 6028abbb99423acf737bada083b518e45aae0692 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Thu, 16 Dec 2010 13:10:09 +0000 Subject: [PATCH] Added definition of macro scst_assert_activity_suspended(). git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3103 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst.h | 7 +++++++ scst/src/scst_main.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/scst/include/scst.h b/scst/include/scst.h index e9d9ec49d..25d639506 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -3685,6 +3685,13 @@ static inline int cancel_delayed_work_sync(struct work_struct *work) } #endif +#ifdef CONFIG_DEBUG_LOCK_ALLOC +extern struct lockdep_map scst_suspend_dep_map; +#define scst_assert_activity_suspended() \ + WARN_ON(debug_locks && !lock_is_held(&scst_suspend_dep_map)); +#else +#define scst_assert_activity_suspended() do { } while (0) +#endif int scst_suspend_activity(bool interruptible); void scst_resume_activity(void); diff --git a/scst/src/scst_main.c b/scst/src/scst_main.c index 6558bb5c3..b8996e978 100644 --- a/scst/src/scst_main.c +++ b/scst/src/scst_main.c @@ -149,7 +149,7 @@ wait_queue_head_t scst_dev_cmd_waitQ; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) #ifdef CONFIG_LOCKDEP static struct lock_class_key scst_suspend_key; -static struct lockdep_map scst_suspend_dep_map = +struct lockdep_map scst_suspend_dep_map = STATIC_LOCKDEP_MAP_INIT("scst_suspend_activity", &scst_suspend_key); #endif #endif