Skip to content
Snippets Groups Projects
Commit 6bb1d8d3 authored by Nathan Rutman's avatar Nathan Rutman
Browse files

b=10762

i=adilger
i=green
prepare for variable watchdogs (will be in added in bug 3055)
parent 6fcd05ba
No related branches found
No related tags found
No related merge requests found
...@@ -358,6 +358,7 @@ struct lc_watchdog *lc_watchdog_add(int time, ...@@ -358,6 +358,7 @@ struct lc_watchdog *lc_watchdog_add(int time,
void *data); void *data);
/* Enables a watchdog and resets its timer. */ /* 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); void lc_watchdog_touch(struct lc_watchdog *lcw);
/* Disable a watchdog; touch it to restart it. */ /* Disable a watchdog; touch it to restart it. */
......
...@@ -314,7 +314,7 @@ static void lcw_update_time(struct lc_watchdog *lcw, const char *message) ...@@ -314,7 +314,7 @@ static void lcw_update_time(struct lc_watchdog *lcw, const char *message)
lcw->lcw_last_touched = newtime; 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; ENTRY;
LASSERT(lcw != NULL); LASSERT(lcw != NULL);
...@@ -326,10 +326,18 @@ void lc_watchdog_touch(struct lc_watchdog *lcw) ...@@ -326,10 +326,18 @@ void lc_watchdog_touch(struct lc_watchdog *lcw)
lcw_update_time(lcw, "touched"); lcw_update_time(lcw, "touched");
lcw->lcw_state = LC_WATCHDOG_ENABLED; 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; 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); EXPORT_SYMBOL(lc_watchdog_touch);
void lc_watchdog_disable(struct lc_watchdog *lcw) void lc_watchdog_disable(struct lc_watchdog *lcw)
...@@ -395,6 +403,11 @@ struct lc_watchdog *lc_watchdog_add(int timeout_ms, ...@@ -395,6 +403,11 @@ struct lc_watchdog *lc_watchdog_add(int timeout_ms,
} }
EXPORT_SYMBOL(lc_watchdog_add); 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) void lc_watchdog_touch(struct lc_watchdog *lcw)
{ {
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment