policy->pol_state = NRS_POL_STATE_STOPPED;
if (cfs_atomic_dec_and_test(&policy->pol_desc->pd_refs))
- cfs_module_put(policy->pol_desc->pd_owner);
+ module_put(policy->pol_desc->pd_owner);
EXIT;
}
* modules.
*/
if (cfs_atomic_inc_return(&policy->pol_desc->pd_refs) == 1 &&
- !cfs_try_module_get(policy->pol_desc->pd_owner)) {
+ !try_module_get(policy->pol_desc->pd_owner)) {
cfs_atomic_dec(&policy->pol_desc->pd_refs);
CERROR("NRS: cannot get module for policy %s; is it alive?\n",
policy->pol_desc->pd_name);
spin_lock(&nrs->nrs_lock);
if (rc != 0) {
if (cfs_atomic_dec_and_test(&policy->pol_desc->pd_refs))
- cfs_module_put(policy->pol_desc->pd_owner);
+ module_put(policy->pol_desc->pd_owner);
policy->pol_state = NRS_POL_STATE_STOPPED;
GOTO(out, rc);
LASSERT(desc->pd_compat != NULL);
OBD_CPT_ALLOC_GFP(policy, svcpt->scp_service->srv_cptable,
- svcpt->scp_cpt, sizeof(*policy), CFS_ALLOC_IO);
+ svcpt->scp_cpt, sizeof(*policy), __GFP_IO);
if (policy == NULL)
RETURN(-ENOMEM);
/* ptlrpc/nrs_fifo.c */
extern struct ptlrpc_nrs_pol_conf nrs_conf_fifo;
+#if defined HAVE_SERVER_SUPPORT && defined(__KERNEL__)
+/* ptlrpc/nrs_crr.c */
+extern struct ptlrpc_nrs_pol_conf nrs_conf_crrn;
+/* ptlrpc/nrs_orr.c */
+extern struct ptlrpc_nrs_pol_conf nrs_conf_orr;
+extern struct ptlrpc_nrs_pol_conf nrs_conf_trr;
+#endif
/**
* Adds all policies that ship with the ptlrpc module, to NRS core's list of
if (rc != 0)
GOTO(fail, rc);
+#if defined HAVE_SERVER_SUPPORT && defined(__KERNEL__)
+ rc = ptlrpc_nrs_policy_register(&nrs_conf_crrn);
+ if (rc != 0)
+ GOTO(fail, rc);
+
+ rc = ptlrpc_nrs_policy_register(&nrs_conf_orr);
+ if (rc != 0)
+ GOTO(fail, rc);
+
+ rc = ptlrpc_nrs_policy_register(&nrs_conf_trr);
+ if (rc != 0)
+ GOTO(fail, rc);
+#endif
+
RETURN(rc);
fail:
/**