Whamcloud - gitweb
b=10762
authornathan <nathan>
Thu, 9 Aug 2007 15:41:30 +0000 (15:41 +0000)
committernathan <nathan>
Thu, 9 Aug 2007 15:41:30 +0000 (15:41 +0000)
i=adilger
i=green
prepare for variable watchdogs (will be in added in bug 3055)

lnet/include/libcfs/libcfs.h
lnet/libcfs/watchdog.c

index 88f1a37..66bf9a8 100644 (file)
@@ -358,6 +358,7 @@ struct lc_watchdog *lc_watchdog_add(int time,
                                     void *data);
 
 /* Enables a watchdog and resets its timer. */
+void lc_watchdog_touch_ms(struct lc_watchdog *lcw, int timeout_ms);
 void lc_watchdog_touch(struct lc_watchdog *lcw);
 
 /* Disable a watchdog; touch it to restart it. */
index 22754af..89d757c 100644 (file)
@@ -314,7 +314,7 @@ static void lcw_update_time(struct lc_watchdog *lcw, const char *message)
         lcw->lcw_last_touched = newtime;
 }
 
-void lc_watchdog_touch(struct lc_watchdog *lcw)
+void lc_watchdog_touch_ms(struct lc_watchdog *lcw, int timeout_ms)
 {
         ENTRY;
         LASSERT(lcw != NULL);
@@ -326,10 +326,18 @@ void lc_watchdog_touch(struct lc_watchdog *lcw)
         lcw_update_time(lcw, "touched");
         lcw->lcw_state = LC_WATCHDOG_ENABLED;
 
-        mod_timer(&lcw->lcw_timer, jiffies + lcw->lcw_time);
+        mod_timer(&lcw->lcw_timer, jiffies +
+                  cfs_time_seconds(timeout_ms) / 1000);
 
         EXIT;
 }
+EXPORT_SYMBOL(lc_watchdog_touch_ms);
+
+/* deprecated - use above instead */
+void lc_watchdog_touch(struct lc_watchdog *lcw)
+{
+        lc_watchdog_touch_ms(lcw, cfs_duration_sec(lcw->lcw_time) * 1000);
+}
 EXPORT_SYMBOL(lc_watchdog_touch);
 
 void lc_watchdog_disable(struct lc_watchdog *lcw)
@@ -395,6 +403,11 @@ struct lc_watchdog *lc_watchdog_add(int timeout_ms,
 }
 EXPORT_SYMBOL(lc_watchdog_add);
 
+void lc_watchdog_touch_ms(struct lc_watchdog *lcw, int timeout_ms)
+{
+}
+EXPORT_SYMBOL(lc_watchdog_touch_ms);
+
 void lc_watchdog_touch(struct lc_watchdog *lcw)
 {
 }