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