scrub->os_pos_current = sf->sf_pos_latest_start;
sf->sf_status = SS_SCANNING;
- sf->sf_time_latest_start = cfs_time_current_sec();
+ sf->sf_time_latest_start = ktime_get_real_seconds();
sf->sf_time_last_checkpoint = sf->sf_time_latest_start;
sf->sf_pos_last_checkpoint = sf->sf_pos_latest_start - 1;
rc = scrub_file_store(env, scrub);
scrub->os_new_checked = 0;
sf->sf_pos_last_checkpoint = scrub->os_pos_current;
}
- sf->sf_time_last_checkpoint = cfs_time_current_sec();
+ sf->sf_time_last_checkpoint = ktime_get_real_seconds();
if (result > 0) {
sf->sf_status = SS_COMPLETED;
if (!(sf->sf_param & SP_DRYRUN)) {
} else {
sf->sf_status = SS_FAILED;
}
- sf->sf_run_time += cfs_duration_sec(cfs_time_current() + HALF_SEC -
- scrub->os_time_last_checkpoint);
+ sf->sf_run_time += ktime_get_seconds() -
+ scrub->os_time_last_checkpoint;
+
rc = scrub_file_store(env, scrub);
up_write(&scrub->os_rwsem);
/* PENDING */
{
- .olm_name = "PENDING",
+ .olm_name = MDT_ORPHAN_DIR,
},
/* ROOT */
RETURN(rc == -EALREADY ? 0 : rc);
}
-static void osd_scrub_stop(struct osd_device *dev)
+void osd_scrub_stop(struct osd_device *dev)
{
struct lustre_scrub *scrub = &dev->od_scrub;
ENTRY;
if (IS_ERR_OR_NULL(obj))
RETURN(obj ? PTR_ERR(obj) : -ENOENT);
+ obj->do_body_ops = &osd_body_scrub_ops;
scrub->os_obj = obj;
rc = scrub_file_load(env, scrub);
if (rc == -ENOENT || rc == -EFAULT) {
"failed to allocate RAM for report\n",
osd_name(dev));
} else {
- class_uuid_unparse(sf->sf_uuid, old_uuid);
- class_uuid_unparse(dev->od_uuid, new_uuid);
- CDEBUG(D_LFSCK, "%s: UUID has been changed "
- "from %s to %s\n", osd_name(dev),
+ snprintf(old_uuid->uuid, UUID_SIZE, "%pU", sf->sf_uuid);
+ snprintf(new_uuid->uuid, UUID_SIZE, "%pU", dev->od_uuid);
+ CDEBUG(D_LFSCK,
+ "%s: UUID has been changed from %s to %s\n",
+ osd_name(dev),
old_uuid->uuid, new_uuid->uuid);
}
scrub_file_reset(scrub, dev->od_uuid, SF_INCONSISTENT);