size_t count, loff_t *off)
{
struct obd_device *dev;
- int val, rc;
+ int rc;
+ __s64 val;
dev = ((struct seq_file *)file->private_data)->private;
- rc = lprocfs_write_helper(buffer, count, &val);
+ rc = lprocfs_str_to_s64(buffer, count, &val);
if (rc)
return rc;
if (val < 0 || val > 1)
if (dev->u.cli.cl_import->imp_deactive == val)
rc = ptlrpc_set_import_active(dev->u.cli.cl_import, val);
else
- CDEBUG(D_CONFIG, "activate %d: ignoring repeat request\n", val);
+ CDEBUG(D_CONFIG, "activate "LPD64": ignoring repeat request\n",
+ val);
return count;
}
loff_t *off)
{
struct obd_device *dev = ((struct seq_file *)file->private_data)->private;
- int val;
+ __s64 val;
int rc;
- rc = lprocfs_write_helper(buffer, count, &val);
- if (rc == 0)
- rc = obd_set_max_rpcs_in_flight(&dev->u.cli, val);
+ rc = lprocfs_str_to_s64(buffer, count, &val);
+ if (rc)
+ return rc;
- if (rc != 0)
- count = rc;
+ if (val < 0 || val > UINT_MAX)
+ return -ERANGE;
+
+ rc = obd_set_max_rpcs_in_flight(&dev->u.cli, val);
+ if (rc)
+ return rc;
return count;
}
{
struct obd_device *dev =
((struct seq_file *)file->private_data)->private;
- int val;
+ __s64 val;
int rc;
- rc = lprocfs_write_helper(buffer, count, &val);
- if (rc != 0)
+ rc = lprocfs_str_to_s64(buffer, count, &val);
+ if (rc)
return rc;
if (val < 0 || val > USHRT_MAX)
return -ERANGE;
rc = obd_set_max_mod_rpcs_in_flight(&dev->u.cli, val);
- if (rc != 0)
+ if (rc)
count = rc;
return count;