case ARS_STARTED: {
struct hsm_progress_kernel pgs;
struct cdt_agent_req *car;
- cfs_time_t now = cfs_time_current_sec();
- cfs_time_t last;
+ time64_t now = ktime_get_real_seconds();
+ time64_t last;
if (!hsd->housekeeping)
break;
break;
if ((larr->arr_req_change + cdt->cdt_grace_delay) <
- cfs_time_current_sec()) {
+ ktime_get_real_seconds()) {
cdt_agent_record_hash_del(cdt,
larr->arr_hai.hai_cookie);
RETURN(LLOG_DEL_RECORD);
struct mdt_device *mdt = mti->mti_mdt;
struct coordinator *cdt = &mdt->mdt_coordinator;
struct hsm_scan_data hsd = { NULL };
- time64_t wait_event_time = 1 * HZ;
time64_t last_housekeeping = 0;
int rc = 0;
int request_sz;
struct hsm_record_update *updates;
/* Limit execution of the expensive requests traversal
- * to at most every "wait_event_time" jiffies. This prevents
- * repeatedly locking/unlocking the catalog for each request
- * and preventing other HSM operations from happening */
+ * to at most one second. This prevents repeatedly
+ * locking/unlocking the catalog for each request
+ * and preventing other HSM operations from happening
+ */
wait_event_interruptible_timeout(cdt->cdt_waitq,
kthread_should_stop() ||
cdt->cdt_wakeup_coordinator,
- wait_event_time);
+ cfs_time_seconds(1));
cdt->cdt_wakeup_coordinator = false;
CDEBUG(D_HSM, "coordinator resumes\n");
/* If no event, and no housekeeping to do, continue to
* wait. */
if (last_housekeeping + cdt->cdt_loop_period <=
- get_seconds()) {
- last_housekeeping = get_seconds();
+ ktime_get_real_seconds()) {
+ last_housekeeping = ktime_get_real_seconds();
hsd.housekeeping = true;
} else if (cdt->cdt_event) {
hsd.housekeeping = false;
* when being re-started */
if (larr->arr_status == ARS_STARTED) {
larr->arr_status = ARS_WAITING;
- larr->arr_req_change = cfs_time_current_sec();
+ larr->arr_req_change = ktime_get_real_seconds();
rc = llog_write(env, llh, hdr, hdr->lrh_index);
if (rc != 0)
GOTO(out, rc);
/* Initialize cdt_compound_id here to allow its usage for
* delayed requests from RAoLU policy */
- atomic_set(&cdt->cdt_compound_id, cfs_time_current_sec());
+ atomic_set(&cdt->cdt_compound_id, ktime_get_real_seconds());
/* by default do not remove archives on last unlink */
cdt->cdt_remove_archive_on_last_unlink = false;
/* just need to be larger than previous one */
/* cdt_last_cookie is protected by cdt_llog_lock */
- cdt->cdt_last_cookie = cfs_time_current_sec();
+ cdt->cdt_last_cookie = ktime_get_real_seconds();
atomic_set(&cdt->cdt_request_count, 0);
cdt->cdt_user_request_mask = (1UL << HSMA_RESTORE);
cdt->cdt_group_request_mask = (1UL << HSMA_RESTORE);
if (larr->arr_status == ARS_WAITING ||
larr->arr_status == ARS_STARTED) {
larr->arr_status = ARS_CANCELED;
- larr->arr_req_change = cfs_time_current_sec();
+ larr->arr_req_change = ktime_get_real_seconds();
rc = llog_write(env, llh, hdr, hdr->lrh_index);
}
larr->arr_compound_id = compound_id;
larr->arr_archive_id = archive_id;
larr->arr_flags = flags;
- larr->arr_req_create = cfs_time_current_sec();
+ larr->arr_req_create = ktime_get_real_seconds();
larr->arr_req_change = larr->arr_req_create;
memcpy(&larr->arr_hai, hai, hai->hai_len);
struct hsm_record_update *updates;
unsigned int updates_count;
unsigned int updates_done;
- cfs_time_t change_time;
+ time64_t change_time;
};
/**
ducb.updates = updates;
ducb.updates_count = updates_count;
ducb.updates_done = 0;
- ducb.change_time = cfs_time_current_sec();
+ ducb.change_time = ktime_get_real_seconds();
rc = cdt_llog_process(env, mdt, mdt_agent_record_update_cb, &ducb,
start_cat_idx, start_rec_idx, WRITE);
* list */
struct mutex cdt_restore_lock; /**< protect restore
* list */
- cfs_time_t cdt_loop_period; /**< llog scan period */
- cfs_time_t cdt_grace_delay; /**< request grace
+ time64_t cdt_loop_period; /**< llog scan period */
+ time64_t cdt_grace_delay; /**< request grace
* delay */
- cfs_time_t cdt_active_req_timeout; /**< request timeout */
+ time64_t cdt_active_req_timeout; /**< request timeout */
__u32 cdt_default_archive_id; /**< archive id used
* when none are
* specified */
struct obd_uuid car_uuid; /**< agent doing the req. */
__u32 car_archive_id; /**< archive id */
int car_canceled; /**< request was canceled */
- cfs_time_t car_req_start; /**< start time */
- cfs_time_t car_req_update; /**< last update time */
+ time64_t car_req_start; /**< start time */
+ time64_t car_req_update; /**< last update time */
struct hsm_action_item *car_hai; /**< req. to the agent */
struct cdt_req_progress car_progress; /**< track data mvt
* progress */