* GPL HEADER END
*/
/*
- * Copyright (c) 2011 Intel Corporation
+ * Copyright (c) 2013, Intel Corporation.
*
* Copyright 2012 Xyratex Technology Limited
*/
/**
* Prints a warning message if an ORR/TRR policy is started on a service with
- * more than one CPT.
+ * more than one CPT. Not printed on the console for now, since we don't
+ * have any performance metrics in the first place, and it is annoying.
*
* \param[in] policy the policy instance
*
*/
static int nrs_orr_init(struct ptlrpc_nrs_policy *policy)
{
- if (policy->pol_nrs->nrs_svcpt->scp_service->srv_ncpts > 1) {
- bool is_orr = strncmp(policy->pol_desc->pd_name,
- NRS_POL_NAME_ORR, NRS_POL_NAME_MAX) == 0;
-
- CWARN("A%s %s NRS policy has been registered on a PTLRPC "
- "service which has more than one service partition. "
- "Please be advised that this policy may perform better "
- "on services with only one partition.\n",
- is_orr ? "n" : "", policy->pol_desc->pd_name);
- }
+ if (policy->pol_nrs->nrs_svcpt->scp_service->srv_ncpts > 1)
+ CDEBUG(D_CONFIG, "%s: The %s NRS policy was registered on a "
+ "service with multiple service partitions. This policy "
+ "may perform better with a single partition.\n",
+ policy->pol_nrs->nrs_svcpt->scp_service->srv_name,
+ policy->pol_desc->pd_name);
+
return 0;
}
/**
* Slab cache for NRS ORR/TRR objects.
*/
- orrd->od_cache = cfs_mem_cache_create(orrd->od_objname,
- sizeof(struct nrs_orr_object),
- 0, 0);
+ orrd->od_cache = kmem_cache_create(orrd->od_objname,
+ sizeof(struct nrs_orr_object),
+ 0, 0, NULL);
if (orrd->od_cache == NULL)
GOTO(failed, rc = -ENOMEM);
failed:
if (orrd->od_cache) {
- rc = cfs_mem_cache_destroy(orrd->od_cache);
+ kmem_cache_destroy(orrd->od_cache);
LASSERTF(rc == 0, "Could not destroy od_cache slab\n");
}
if (orrd->od_binheap != NULL)
cfs_binheap_destroy(orrd->od_binheap);
cfs_hash_putref(orrd->od_obj_hash);
- cfs_mem_cache_destroy(orrd->od_cache);
+ kmem_cache_destroy(orrd->od_cache);
OBD_FREE_PTR(orrd);
}
{
LASSERT(spin_is_locked(&policy->pol_nrs->nrs_lock));
- switch(opc) {
+ switch((enum nrs_ctl_orr)opc) {
default:
RETURN(-EINVAL);
OBD_SLAB_CPT_ALLOC_PTR_GFP(orro, orrd->od_cache,
nrs_pol2cptab(policy), nrs_pol2cptid(policy),
- moving_req ? CFS_ALLOC_ATOMIC :
- CFS_ALLOC_IO);
+ (moving_req ? GFP_ATOMIC :
+ __GFP_IO));
if (orro == NULL)
RETURN(-ENOMEM);
if (count > (sizeof(kernbuf) - 1))
return -EINVAL;
- if (cfs_copy_from_user(kernbuf, buffer, count))
+ if (copy_from_user(kernbuf, buffer, count))
return -EFAULT;
kernbuf[count] = '\0';
if (count > (sizeof(kernbuf) - 1))
return -EINVAL;
- if (cfs_copy_from_user(kernbuf, buffer, count))
+ if (copy_from_user(kernbuf, buffer, count))
return -EFAULT;
kernbuf[count] = '\0';
if (count > (sizeof(kernbuf) - 1))
return -EINVAL;
- if (cfs_copy_from_user(kernbuf, buffer, count))
+ if (copy_from_user(kernbuf, buffer, count))
return -EFAULT;
kernbuf[count] = '\0';