*/
static int ldlm_srv_pool_recalc(struct ldlm_pool *pl)
{
- time_t recalc_interval_sec;
+ time64_t recalc_interval_sec;
- recalc_interval_sec = get_seconds() - pl->pl_recalc_time;
+ recalc_interval_sec = ktime_get_real_seconds() - pl->pl_recalc_time;
if (recalc_interval_sec < pl->pl_recalc_period)
return 0;
spin_lock(&pl->pl_lock);
- recalc_interval_sec = get_seconds() - pl->pl_recalc_time;
+ recalc_interval_sec = ktime_get_real_seconds() - pl->pl_recalc_time;
if (recalc_interval_sec < pl->pl_recalc_period) {
spin_unlock(&pl->pl_lock);
return 0;
*/
ldlm_pool_recalc_grant_plan(pl);
- pl->pl_recalc_time = get_seconds();
+ pl->pl_recalc_time = ktime_get_real_seconds();
lprocfs_counter_add(pl->pl_stats, LDLM_POOL_TIMING_STAT,
recalc_interval_sec);
spin_unlock(&pl->pl_lock);
*/
static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
{
- time_t recalc_interval_sec;
+ time64_t recalc_interval_sec;
int ret;
- recalc_interval_sec = get_seconds() - pl->pl_recalc_time;
+ recalc_interval_sec = ktime_get_real_seconds() - pl->pl_recalc_time;
if (recalc_interval_sec < pl->pl_recalc_period)
return 0;
/*
* Check if we need to recalc lists now.
*/
- recalc_interval_sec = get_seconds() - pl->pl_recalc_time;
+ recalc_interval_sec = ktime_get_real_seconds() - pl->pl_recalc_time;
if (recalc_interval_sec < pl->pl_recalc_period) {
spin_unlock(&pl->pl_lock);
return 0;
* Time of LRU resizing might be longer than period,
* so update after LRU resizing rather than before it.
*/
- pl->pl_recalc_time = get_seconds();
+ pl->pl_recalc_time = ktime_get_real_seconds();
lprocfs_counter_add(pl->pl_stats, LDLM_POOL_TIMING_STAT,
recalc_interval_sec);
spin_unlock(&pl->pl_lock);
*/
int ldlm_pool_recalc(struct ldlm_pool *pl)
{
- time_t recalc_interval_sec;
+ u32 recalc_interval_sec;
int count;
- recalc_interval_sec = get_seconds() - pl->pl_recalc_time;
+ recalc_interval_sec = ktime_get_seconds() - pl->pl_recalc_time;
if (recalc_interval_sec <= 0)
goto recalc;
lprocfs_counter_add(pl->pl_stats, LDLM_POOL_RECALC_STAT,
count);
}
- recalc_interval_sec = pl->pl_recalc_time - get_seconds() +
+ recalc_interval_sec = pl->pl_recalc_time - ktime_get_seconds() +
pl->pl_recalc_period;
if (recalc_interval_sec <= 0) {
/* Prevent too frequent recalculation. */
- CDEBUG(D_DLMTRACE, "Negative interval(%ld), "
- "too short period(%ld)",
+ CDEBUG(D_DLMTRACE,
+ "Negative interval(%d), too short period(%lld)",
recalc_interval_sec,
- pl->pl_recalc_period);
+ (s64)pl->pl_recalc_period);
recalc_interval_sec = 1;
}
spin_lock_init(&pl->pl_lock);
atomic_set(&pl->pl_granted, 0);
- pl->pl_recalc_time = get_seconds();
+ pl->pl_recalc_time = ktime_get_seconds();
atomic_set(&pl->pl_lock_volume_factor, 1);
atomic_set(&pl->pl_grant_rate, 0);