Whamcloud - gitweb
LU-3335 scrub: purge inconsistenct objects after OI scrub
[fs/lustre-release.git] / lustre / lfsck / lfsck_lib.c
index 1a62adf..fc612fc 100644 (file)
  * Author: Fan, Yong <fan.yong@intel.com>
  */
 
-#ifndef EXPORT_SYMTAB
-# define EXPORT_SYMTAB
-#endif
 #define DEBUG_SUBSYSTEM S_LFSCK
 
 #include <libcfs/list.h>
 #include <lu_object.h>
 #include <dt_object.h>
+#include <md_object.h>
+#include <lustre_fld.h>
 #include <lustre_lib.h>
 #include <lustre_net.h>
 #include <lustre_lfsck.h>
@@ -870,7 +869,7 @@ int lfsck_start(const struct lu_env *env, struct dt_device *key,
        struct lfsck_component *com;
        struct l_wait_info      lwi    = { 0 };
        bool                    dirty  = false;
-       int                     rc     = 0;
+       long                    rc     = 0;
        __u16                   valid  = 0;
        __u16                   flags  = 0;
        ENTRY;
@@ -1015,17 +1014,19 @@ trigger:
        lfsck->li_args_oit = (flags << DT_OTABLE_IT_FLAGS_SHIFT) | valid;
        thread_set_flags(thread, 0);
        if (lfsck->li_master)
-               rc = cfs_create_thread(lfsck_master_engine, lfsck, 0);
-       if (rc < 0)
-               CERROR("%s: cannot start LFSCK thread, rc = %d\n",
+               rc = PTR_ERR(kthread_run(lfsck_master_engine, lfsck, "lfsck"));
+       if (IS_ERR_VALUE(rc)) {
+               CERROR("%s: cannot start LFSCK thread, rc = %ld\n",
                       lfsck_lfsck2name(lfsck), rc);
-       else
+       } else {
+               rc = 0;
                l_wait_event(thread->t_ctl_waitq,
                             thread_is_running(thread) ||
                             thread_is_stopped(thread),
                             &lwi);
+       }
 
-       GOTO(out, rc = 0);
+       GOTO(out, rc);
 
 out:
        mutex_unlock(&lfsck->li_mutex);