Whamcloud - gitweb
git://git.whamcloud.com
/
fs
/
lustre-release.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
LU-9325 obd: replace lprocfs_str_to_s64
[fs/lustre-release.git]
/
lustre
/
obdclass
/
lprocfs_status_server.c
diff --git
a/lustre/obdclass/lprocfs_status_server.c
b/lustre/obdclass/lprocfs_status_server.c
index
08f3f18
..
0e07dd6
100644
(file)
--- a/
lustre/obdclass/lprocfs_status_server.c
+++ b/
lustre/obdclass/lprocfs_status_server.c
@@
-772,11
+772,11
@@
lprocfs_ir_factor_seq_write(struct file *file, const char __user *buffer,
{
struct seq_file *m = file->private_data;
struct obd_device *obd = m->private;
+ int val;
int rc;
- __s64 val;
LASSERT(obd != NULL);
- rc =
lprocfs_str_to_s64(buffer, count
, &val);
+ rc =
kstrtoint_from_user(buffer, count, 10
, &val);
if (rc)
return rc;
@@
-804,15
+804,15
@@
lprocfs_checksum_dump_seq_write(struct file *file, const char __user *buffer,
{
struct seq_file *m = file->private_data;
struct obd_device *obd = m->private;
+ bool val;
int rc;
- __s64 val;
LASSERT(obd != NULL);
- rc =
lprocfs_str_to_s64
(buffer, count, &val);
+ rc =
kstrtobool_from_user
(buffer, count, &val);
if (rc)
return rc;
- obd->obd_checksum_dump =
!!
val;
+ obd->obd_checksum_dump = val;
return count;
}
EXPORT_SYMBOL(lprocfs_checksum_dump_seq_write);
@@
-834,15
+834,13
@@
lprocfs_recovery_time_soft_seq_write(struct file *file,
{
struct seq_file *m = file->private_data;
struct obd_device *obd = m->private;
+ unsigned int val;
int rc;
- __s64 val;
LASSERT(obd != NULL);
- rc =
lprocfs_str_to_s64(buffer, count
, &val);
+ rc =
kstrtouint_from_user(buffer, count, 0
, &val);
if (rc)
return rc;
- if (val < 0 || val > INT_MAX)
- return -ERANGE;
obd->obd_recovery_timeout = val;
return count;
@@
-866,15
+864,13
@@
lprocfs_recovery_time_hard_seq_write(struct file *file,
{
struct seq_file *m = file->private_data;
struct obd_device *obd = m->private;
+ unsigned int val;
int rc;
- __s64 val;
LASSERT(obd != NULL);
- rc =
lprocfs_str_to_s64(buffer, count
, &val);
+ rc =
kstrtouint_from_user(buffer, count, 0
, &val);
if (rc)
return rc;
- if (val < 0 || val > INT_MAX)
- return -ERANGE;
obd->obd_recovery_time_hard = val;
return count;