} od_stats;
/* configuration item(s) */
- int od_contention_time;
+ time64_t od_contention_time;
int od_lockless_truncate;
};
* True if locking against this stripe got -EUSERS.
*/
int oo_contended;
- cfs_time_t oo_contention_time;
+ time64_t oo_contention_time;
#ifdef CONFIG_LUSTRE_DEBUG_EXPENSIVE_CHECK
/**
* IO context used for invariant checks in osc_lock_has_pages().
static inline void osc_object_set_contended(struct osc_object *obj)
{
- obj->oo_contention_time = cfs_time_current();
+ obj->oo_contention_time = ktime_get_seconds();
/* mb(); */
obj->oo_contended = 1;
}
/**
* Submit time - the time when the page is starting RPC. For debugging.
*/
- cfs_time_t ops_submit_time;
+ time64_t ops_submit_time;
};
struct osc_brw_async_args {
struct obd_device *obd = m->private;
struct osc_device *od = obd2osc_dev(obd);
- seq_printf(m, "%u\n", od->od_contention_time);
+ seq_printf(m, "%lld\n", od->od_contention_time);
return 0;
}
struct obd_device *obd = m->private;
struct osc_device *od = obd2osc_dev(obd);
- seq_printf(m, "%u\n", od->od_contention_time);
+ seq_printf(m, "%lld\n", od->od_contention_time);
return 0;
}
ENTRY;
result = cl_page_make_ready(env, page, CRT_WRITE);
if (result == 0)
- opg->ops_submit_time = cfs_time_current();
+ opg->ops_submit_time = ktime_get_seconds();
RETURN(result);
}
int osc_object_is_contended(struct osc_object *obj)
{
- struct osc_device *dev = lu2osc_dev(obj->oo_cl.co_lu.lo_dev);
- int osc_contention_time = dev->od_contention_time;
- cfs_time_t cur_time = cfs_time_current();
- cfs_time_t retry_time;
+ struct osc_device *dev = lu2osc_dev(obj->oo_cl.co_lu.lo_dev);
+ time64_t osc_contention_time = dev->od_contention_time;
+ time64_t retry_time;
if (OBD_FAIL_CHECK(OBD_FAIL_OSC_OBJECT_CONTENTION))
return 1;
if (!obj->oo_contended)
return 0;
- /*
- * I like copy-paste. the code is copied from
- * ll_file_is_contended.
- */
- retry_time = cfs_time_add(obj->oo_contention_time,
- cfs_time_seconds(osc_contention_time));
- if (cfs_time_after(cur_time, retry_time)) {
- osc_object_clear_contended(obj);
- return 0;
- }
- return 1;
+ /*
+ * I like copy-paste. the code is copied from
+ * ll_file_is_contended.
+ */
+ retry_time = obj->oo_contention_time + osc_contention_time;
+ if (ktime_get_seconds() > retry_time) {
+ osc_object_clear_contended(obj);
+ return 0;
+ }
+ return 1;
}
EXPORT_SYMBOL(osc_object_is_contended);
return list_empty(head) ? "-" : "+";
}
-static inline cfs_time_t osc_submit_duration(struct osc_page *opg)
+static inline time64_t osc_submit_duration(struct osc_page *opg)
{
- if (opg->ops_submit_time == 0)
- return 0;
+ if (opg->ops_submit_time == 0)
+ return 0;
- return (cfs_time_current() - opg->ops_submit_time);
+ return ktime_get_seconds() - opg->ops_submit_time;
}
static int osc_page_print(const struct lu_env *env,
return (*printer)(env, cookie, LUSTRE_OSC_NAME"-page@%p %lu: "
"1< %#x %d %u %s %s > "
"2< %lld %u %u %#x %#x | %p %p %p > "
- "3< %d %lu %d > "
+ "3< %d %lld %d > "
"4< %d %d %d %lu %s | %s %s %s %s > "
"5< %s %s %s %s | %d %s | %d %s %s>\n",
opg, osc_index(opg),
oap->oap_cmd |= OBD_BRW_NOQUOTA;
}
- opg->ops_submit_time = cfs_time_current();
+ opg->ops_submit_time = ktime_get_seconds();
osc_page_transfer_get(opg, "transfer\0imm");
osc_page_transfer_add(env, opg, crt);
}