val = lprocfs_find_named_value(kernbuf, NRS_LPROCFS_QUANTUM_NAME_REG,
&count_copy);
if (val != kernbuf) {
- quantum_reg = simple_strtol(val, NULL, 10);
-
+ rc = kstrtol(val, 10, &quantum_reg);
+ if (rc)
+ return rc;
queue |= PTLRPC_NRS_QUEUE_REG;
}
if (!nrs_svc_has_hp(svc))
return -ENODEV;
- quantum_hp = simple_strtol(val, NULL, 10);
+ rc = kstrtol(val, 10, &quantum_hp);
+ if (rc)
+ return rc;
queue |= PTLRPC_NRS_QUEUE_HP;
}
* value
*/
if (queue == 0) {
- if (!isdigit(kernbuf[0]))
- return -EINVAL;
-
- quantum_reg = simple_strtol(kernbuf, NULL, 10);
+ rc = kstrtol(kernbuf, 10, &quantum_reg);
+ if (rc)
+ return rc;
queue = PTLRPC_NRS_QUEUE_REG;
{
int i;
- struct lprocfs_vars nrs_orr_lprocfs_vars[] = {
+ struct ldebugfs_vars nrs_orr_lprocfs_vars[] = {
{ .name = "nrs_orr_quantum",
.fops = &ptlrpc_lprocfs_nrs_orr_quantum_fops },
{ .name = "nrs_orr_offset_type",
{ NULL }
};
- if (IS_ERR_OR_NULL(svc->srv_debugfs_entry))
+ if (!svc->srv_debugfs_entry)
return 0;
lprocfs_orr_data.svc = svc;
for (i = 0; i < ARRAY_SIZE(nrs_orr_lprocfs_vars); i++)
nrs_orr_lprocfs_vars[i].data = &lprocfs_orr_data;
- return ldebugfs_add_vars(svc->srv_debugfs_entry, nrs_orr_lprocfs_vars,
- NULL);
+ ldebugfs_add_vars(svc->srv_debugfs_entry, nrs_orr_lprocfs_vars, NULL);
+
+ return 0;
}
static const struct ptlrpc_nrs_pol_ops nrs_orr_ops = {
{
int i;
- struct lprocfs_vars nrs_trr_lprocfs_vars[] = {
+ struct ldebugfs_vars nrs_trr_lprocfs_vars[] = {
{ .name = "nrs_trr_quantum",
.fops = &ptlrpc_lprocfs_nrs_orr_quantum_fops },
{ .name = "nrs_trr_offset_type",
{ NULL }
};
- if (IS_ERR_OR_NULL(svc->srv_debugfs_entry))
+ if (!svc->srv_debugfs_entry)
return 0;
lprocfs_trr_data.svc = svc;
for (i = 0; i < ARRAY_SIZE(nrs_trr_lprocfs_vars); i++)
nrs_trr_lprocfs_vars[i].data = &lprocfs_trr_data;
- return ldebugfs_add_vars(svc->srv_debugfs_entry, nrs_trr_lprocfs_vars,
- NULL);
+ ldebugfs_add_vars(svc->srv_debugfs_entry, nrs_trr_lprocfs_vars, NULL);
+
+ return 0;
}
/**