*
* \pre ->pl_lock is not locked.
*/
-static int ldlm_srv_pool_recalc(struct ldlm_pool *pl)
+static int ldlm_srv_pool_recalc(struct ldlm_pool *pl, bool force)
{
timeout_t recalc_interval_sec;
ENTRY;
recalc_interval_sec = ktime_get_seconds() - pl->pl_recalc_time;
- if (recalc_interval_sec < pl->pl_recalc_period)
+ if (!force && recalc_interval_sec < pl->pl_recalc_period)
RETURN(0);
spin_lock(&pl->pl_lock);
recalc_interval_sec = ktime_get_seconds() - pl->pl_recalc_time;
- if (recalc_interval_sec < pl->pl_recalc_period) {
+ if (!force && recalc_interval_sec < pl->pl_recalc_period) {
spin_unlock(&pl->pl_lock);
RETURN(0);
}
/**
* Recalculates client size pool \a pl according to current SLV and Limit.
*/
-static int ldlm_cli_pool_recalc(struct ldlm_pool *pl)
+static int ldlm_cli_pool_recalc(struct ldlm_pool *pl, bool force)
{
timeout_t recalc_interval_sec;
int ret;
ENTRY;
recalc_interval_sec = ktime_get_seconds() - pl->pl_recalc_time;
- if (recalc_interval_sec < pl->pl_recalc_period)
+ if (!force && recalc_interval_sec < pl->pl_recalc_period)
RETURN(0);
spin_lock(&pl->pl_lock);
* Check if we need to recalc lists now.
*/
recalc_interval_sec = ktime_get_seconds() - pl->pl_recalc_time;
- if (recalc_interval_sec < pl->pl_recalc_period) {
+ if (!force && recalc_interval_sec < pl->pl_recalc_period) {
spin_unlock(&pl->pl_lock);
RETURN(0);
}
*
* \retval time in seconds for the next recalc of this pool
*/
-time64_t ldlm_pool_recalc(struct ldlm_pool *pl)
+time64_t ldlm_pool_recalc(struct ldlm_pool *pl, bool force)
{
timeout_t recalc_interval_sec;
int count;
}
if (pl->pl_ops->po_recalc != NULL) {
- count = pl->pl_ops->po_recalc(pl);
+ count = pl->pl_ops->po_recalc(pl, force);
lprocfs_counter_add(pl->pl_stats, LDLM_POOL_RECALC_STAT,
count);
}
* with too long call paths.
*/
if (ns_is_server(ldlm_pl2ns(pl)))
- ldlm_pool_recalc(pl);
+ ldlm_pool_recalc(pl, false);
}
/**
lprocfs_counter_incr(pl->pl_stats, LDLM_POOL_CANCEL_STAT);
if (ns_is_server(ldlm_pl2ns(pl)))
- ldlm_pool_recalc(pl);
+ ldlm_pool_recalc(pl, false);
}
/**
* After setup is done - recalc the pool.
*/
if (!skip) {
- delay = min(delay, ldlm_pool_recalc(&ns->ns_pool));
+ delay = min(delay,
+ ldlm_pool_recalc(&ns->ns_pool, false));
ldlm_namespace_put(ns);
}
}
return 0;
}
-time64_t ldlm_pool_recalc(struct ldlm_pool *pl)
+time64_t ldlm_pool_recalc(struct ldlm_pool *pl, bool force)
{
return 0;
}