int ldlm_pool_setup(struct ldlm_pool *pl, __u32 limit)
{
ENTRY;
- if (ldlm_pl2ns(pl)->ns_client == LDLM_NAMESPACE_SERVER) {
- spin_lock(&pl->pl_lock);
+ if (ns_is_server(ldlm_pl2ns(pl)))
ldlm_pool_set_limit(pl, limit);
- spin_unlock(&pl->pl_lock);
- }
RETURN(0);
}
EXPORT_SYMBOL(ldlm_pool_setup);
pl->pl_name);
nr += snprintf(page + nr, count - nr, " SLV: "LPU64"\n", slv);
- if (ldlm_pl2ns(pl)->ns_client == LDLM_NAMESPACE_CLIENT) {
+ if (ns_is_client(ldlm_pl2ns(pl))) {
nr += snprintf(page + nr, count - nr, " LVF: %d\n",
atomic_read(&pl->pl_lock_volume_factor));
}
snprintf(var_name, MAX_STRING_SIZE, "grant_step");
pool_vars[0].data = &pl->pl_grant_step;
pool_vars[0].read_fptr = lprocfs_rd_atomic;
- if (ns->ns_client == LDLM_NAMESPACE_SERVER)
+ if (ns_is_server(ns))
pool_vars[0].write_fptr = lprocfs_wr_atomic;
lprocfs_add_vars(pl->pl_proc_dir, pool_vars, 0);
- if (ns->ns_client == LDLM_NAMESPACE_CLIENT) {
+ if (ns_is_client(ns)) {
snprintf(var_name, MAX_STRING_SIZE, "lock_volume_factor");
pool_vars[0].data = &pl->pl_lock_volume_factor;
pool_vars[0].read_fptr = lprocfs_rd_uint;
/* No need to recalc client pools here as this is already done
* on enqueue/cancel and locks to cancel already packed to the
* rpc. */
- if (ldlm_pl2ns(pl)->ns_client == LDLM_NAMESPACE_SERVER)
+ if (ns_is_server(ldlm_pl2ns(pl)))
ldlm_pool_recalc(pl);
EXIT;
}
atomic_dec(&pl->pl_grant_speed);
/* Same as in ldlm_pool_add() */
- if (ldlm_pl2ns(pl)->ns_client == LDLM_NAMESPACE_SERVER)
+ if (ns_is_server(ldlm_pl2ns(pl)))
ldlm_pool_recalc(pl);
EXIT;
}
struct l_wait_info lwi;
/* Recal all pools on this tick. */
- ldlm_pools_recalc(LDLM_NAMESPACE_CLIENT);
ldlm_pools_recalc(LDLM_NAMESPACE_SERVER);
+ ldlm_pools_recalc(LDLM_NAMESPACE_CLIENT);
/* Wait until the next check time, or until we're
* stopped. */
complete_and_exit(&ldlm_pools_comp, 0);
}
-static int ldlm_pools_thread_start(ldlm_side_t client)
+static int ldlm_pools_thread_start(void)
{
struct l_wait_info lwi = { 0 };
int rc;
if (ldlm_pools_thread == NULL)
RETURN(-ENOMEM);
- ldlm_pools_thread->t_id = client;
init_completion(&ldlm_pools_comp);
cfs_waitq_init(&ldlm_pools_thread->t_ctl_waitq);
EXIT;
}
-int ldlm_pools_init(ldlm_side_t client)
+int ldlm_pools_init(void)
{
int rc;
ENTRY;
- rc = ldlm_pools_thread_start(client);
+ rc = ldlm_pools_thread_start();
if (rc == 0) {
ldlm_pools_srv_shrinker = set_shrinker(DEFAULT_SEEKS,
ldlm_pools_srv_shrink);
}
EXPORT_SYMBOL(ldlm_pool_set_limit);
-int ldlm_pools_init(ldlm_side_t client)
+int ldlm_pools_init(void)
{
return 0;
}