Whamcloud - gitweb
LU-10699 hsm: remove struct hsm_compat_data_cb
[fs/lustre-release.git] / lustre / lfsck / lfsck_engine.c
index 0af5e95..31b7efa 100644 (file)
@@ -395,8 +395,7 @@ static int lfsck_checkpoint(const struct lu_env *env,
        int                     rc  = 0;
        int                     rc1 = 0;
 
-       if (likely(cfs_time_beforeq(cfs_time_current(),
-                                   lfsck->li_time_next_checkpoint)))
+       if (likely(ktime_get_seconds() <= lfsck->li_time_next_checkpoint))
                return 0;
 
        lfsck_pos_fill(env, lfsck, &lfsck->li_pos_checkpoint, false);
@@ -406,9 +405,9 @@ static int lfsck_checkpoint(const struct lu_env *env,
                        rc1 = rc;
        }
 
-       lfsck->li_time_last_checkpoint = cfs_time_current();
+       lfsck->li_time_last_checkpoint = ktime_get_seconds();
        lfsck->li_time_next_checkpoint = lfsck->li_time_last_checkpoint +
-                               cfs_time_seconds(LFSCK_CHECKPOINT_INTERVAL);
+                                        LFSCK_CHECKPOINT_INTERVAL;
        return rc1 != 0 ? rc1 : rc;
 }
 
@@ -509,9 +508,9 @@ out:
                        break;
        }
 
-       lfsck->li_time_last_checkpoint = cfs_time_current();
+       lfsck->li_time_last_checkpoint = ktime_get_seconds();
        lfsck->li_time_next_checkpoint = lfsck->li_time_last_checkpoint +
-                               cfs_time_seconds(LFSCK_CHECKPOINT_INTERVAL);
+                                        LFSCK_CHECKPOINT_INTERVAL;
        return rc;
 }
 
@@ -608,9 +607,9 @@ static int lfsck_post(const struct lu_env *env, struct lfsck_instance *lfsck,
                               (__u32)com->lc_type, rc);
        }
 
-       lfsck->li_time_last_checkpoint = cfs_time_current();
+       lfsck->li_time_last_checkpoint = ktime_get_seconds();
        lfsck->li_time_next_checkpoint = lfsck->li_time_last_checkpoint +
-                               cfs_time_seconds(LFSCK_CHECKPOINT_INTERVAL);
+                                        LFSCK_CHECKPOINT_INTERVAL;
 
        /* Ignore some component post failure to make other can go ahead. */
        return result;
@@ -1060,6 +1059,11 @@ int lfsck_master_engine(void *args)
               current_pid());
 
        spin_lock(&lfsck->li_lock);
+       if (unlikely(!thread_is_starting(thread))) {
+               spin_unlock(&lfsck->li_lock);
+               GOTO(fini_oit, rc = 0);
+       }
+
        thread_set_flags(thread, SVC_RUNNING);
        spin_unlock(&lfsck->li_lock);
        wake_up_all(&thread->t_ctl_waitq);
@@ -1672,10 +1676,10 @@ int lfsck_assistant_engine(void *args)
 
                        com->lc_new_checked = 0;
                        com->lc_new_scanned = 0;
-                       com->lc_time_last_checkpoint = cfs_time_current();
+                       com->lc_time_last_checkpoint = ktime_get_seconds();
                        com->lc_time_next_checkpoint =
                                com->lc_time_last_checkpoint +
-                               cfs_time_seconds(LFSCK_CHECKPOINT_INTERVAL);
+                               LFSCK_CHECKPOINT_INTERVAL;
 
                        CDEBUG(D_LFSCK, "%s: LFSCK assistant sync before "
                               "the second-stage scaning\n",
@@ -1754,9 +1758,6 @@ cleanup:
        }
        spin_unlock(&lad->lad_lock);
 
-       LASSERTF(lad->lad_prefetched == 0, "unmatched prefeteched objs %d\n",
-                lad->lad_prefetched);
-
        memset(lr, 0, sizeof(*lr));
        if (rc > 0) {
                lr->lr_event = LE_PHASE2_DONE;