+ cfs_spin_lock_bh(&lcw_pending_timers_lock);
+ cfs_list_add(&lcw->lcw_list, &lcw_pending_timers);
+ cfs_waitq_signal(&lcw_event_waitq);
+ cfs_spin_unlock_bh(&lcw_pending_timers_lock);
+
+ EXIT;
+}
+
+static inline void lcw_get(struct lc_watchdog *lcw)
+{
+ cfs_atomic_inc(&lcw->lcw_refcount);
+}
+
+static inline void lcw_put(struct lc_watchdog *lcw)
+{
+ if (cfs_atomic_dec_and_test(&lcw->lcw_refcount)) {
+ LASSERT(cfs_list_empty(&lcw->lcw_list));
+ LIBCFS_FREE(lcw, sizeof(*lcw));
+ }
+}
+
+static int is_watchdog_fired(void)
+{
+ int rc;
+
+ if (cfs_test_bit(LCW_FLAG_STOP, &lcw_flags))
+ return 1;
+
+ cfs_spin_lock_bh(&lcw_pending_timers_lock);
+ rc = !cfs_list_empty(&lcw_pending_timers);
+ cfs_spin_unlock_bh(&lcw_pending_timers_lock);
+ return rc;
+}
+
+static void lcw_dump_stack(struct lc_watchdog *lcw)
+{
+ cfs_time_t current_time;
+ cfs_duration_t delta_time;
+ struct timeval timediff;
+
+ current_time = cfs_time_current();