X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=libcfs%2Flibcfs%2Fwatchdog.c;h=a2bfbbe64a430f55ee91ee1e59c85dc56d8288b3;hp=e08fe68e8601be5cadc02b6a9ecf1ff27b96b8c7;hb=0aec97df129d2c6263c66454ee9039cd5dbfdf85;hpb=08aa217ce49aba1ded52e0f7adb8a607035123fd diff --git a/libcfs/libcfs/watchdog.c b/libcfs/libcfs/watchdog.c index e08fe68..a2bfbbe 100644 --- a/libcfs/libcfs/watchdog.c +++ b/libcfs/libcfs/watchdog.c @@ -104,11 +104,7 @@ static void lcw_dump(struct lc_watchdog *lcw) { ENTRY; -#if defined(HAVE_TASKLIST_LOCK) - read_lock(&tasklist_lock); -#else rcu_read_lock(); -#endif if (lcw->lcw_task == NULL) { LCONSOLE_WARN("Process " LPPID " was not found in the task " "list; watchdog callback may be incomplete\n", @@ -117,11 +113,7 @@ lcw_dump(struct lc_watchdog *lcw) libcfs_debug_dumpstack(lcw->lcw_task); } -#if defined(HAVE_TASKLIST_LOCK) - read_unlock(&tasklist_lock); -#else rcu_read_unlock(); -#endif EXIT; } @@ -213,19 +205,11 @@ static void lcw_dump_stack(struct lc_watchdog *lcw) static int lcw_dispatch_main(void *data) { int rc = 0; - unsigned long flags; struct lc_watchdog *lcw; CFS_LIST_HEAD (zombies); ENTRY; - cfs_daemonize("lc_watchdogd"); - - SIGNAL_MASK_LOCK(current, flags); - sigfillset(¤t->blocked); - RECALC_SIGPENDING; - SIGNAL_MASK_UNLOCK(current, flags); - complete(&lcw_start_completion); while (1) { @@ -312,7 +296,7 @@ static int lcw_dispatch_main(void *data) static void lcw_dispatch_start(void) { - int rc; + cfs_task_t *task; ENTRY; LASSERT(lcw_refcount == 1); @@ -321,13 +305,14 @@ static void lcw_dispatch_start(void) init_completion(&lcw_start_completion); cfs_waitq_init(&lcw_event_waitq); - CDEBUG(D_INFO, "starting dispatch thread\n"); - rc = cfs_create_thread(lcw_dispatch_main, NULL, 0); - if (rc < 0) { - CERROR("error spawning watchdog dispatch thread: %d\n", rc); - EXIT; - return; - } + CDEBUG(D_INFO, "starting dispatch thread\n"); + task = kthread_run(lcw_dispatch_main, NULL, "lc_watchdogd"); + if (IS_ERR(task)) { + CERROR("error spawning watchdog dispatch thread: %ld\n", + PTR_ERR(task)); + EXIT; + return; + } wait_for_completion(&lcw_start_completion); CDEBUG(D_INFO, "watchdog dispatcher initialization complete.\n");