Commit 4f4c337f authored by Fabian Frederick's avatar Fabian Frederick Committed by Linus Torvalds

fs/dlm/config.c: convert simple_str to kstr

Replace obsolete functions

simple_strtoul/kstrtouint
simple_strtol/kstrtoint
(kstr __must_check requires the right function to be applied)
Signed-off-by: default avatarFabian Frederick <fabf@skynet.be>
Cc: Christine Caulfield <ccaulfie@redhat.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 33041a0d
...@@ -157,11 +157,13 @@ static ssize_t cluster_set(struct dlm_cluster *cl, unsigned int *cl_field, ...@@ -157,11 +157,13 @@ static ssize_t cluster_set(struct dlm_cluster *cl, unsigned int *cl_field,
const char *buf, size_t len) const char *buf, size_t len)
{ {
unsigned int x; unsigned int x;
int rc;
if (!capable(CAP_SYS_ADMIN)) if (!capable(CAP_SYS_ADMIN))
return -EPERM; return -EPERM;
rc = kstrtouint(buf, 0, &x);
x = simple_strtoul(buf, NULL, 0); if (rc)
return rc;
if (check_zero && !x) if (check_zero && !x)
return -EINVAL; return -EINVAL;
...@@ -730,7 +732,10 @@ static ssize_t comm_nodeid_read(struct dlm_comm *cm, char *buf) ...@@ -730,7 +732,10 @@ static ssize_t comm_nodeid_read(struct dlm_comm *cm, char *buf)
static ssize_t comm_nodeid_write(struct dlm_comm *cm, const char *buf, static ssize_t comm_nodeid_write(struct dlm_comm *cm, const char *buf,
size_t len) size_t len)
{ {
cm->nodeid = simple_strtol(buf, NULL, 0); int rc = kstrtoint(buf, 0, &cm->nodeid);
if (rc)
return rc;
return len; return len;
} }
...@@ -742,7 +747,10 @@ static ssize_t comm_local_read(struct dlm_comm *cm, char *buf) ...@@ -742,7 +747,10 @@ static ssize_t comm_local_read(struct dlm_comm *cm, char *buf)
static ssize_t comm_local_write(struct dlm_comm *cm, const char *buf, static ssize_t comm_local_write(struct dlm_comm *cm, const char *buf,
size_t len) size_t len)
{ {
cm->local= simple_strtol(buf, NULL, 0); int rc = kstrtoint(buf, 0, &cm->local);
if (rc)
return rc;
if (cm->local && !local_comm) if (cm->local && !local_comm)
local_comm = cm; local_comm = cm;
return len; return len;
...@@ -846,7 +854,10 @@ static ssize_t node_nodeid_write(struct dlm_node *nd, const char *buf, ...@@ -846,7 +854,10 @@ static ssize_t node_nodeid_write(struct dlm_node *nd, const char *buf,
size_t len) size_t len)
{ {
uint32_t seq = 0; uint32_t seq = 0;
nd->nodeid = simple_strtol(buf, NULL, 0); int rc = kstrtoint(buf, 0, &nd->nodeid);
if (rc)
return rc;
dlm_comm_seq(nd->nodeid, &seq); dlm_comm_seq(nd->nodeid, &seq);
nd->comm_seq = seq; nd->comm_seq = seq;
return len; return len;
...@@ -860,7 +871,10 @@ static ssize_t node_weight_read(struct dlm_node *nd, char *buf) ...@@ -860,7 +871,10 @@ static ssize_t node_weight_read(struct dlm_node *nd, char *buf)
static ssize_t node_weight_write(struct dlm_node *nd, const char *buf, static ssize_t node_weight_write(struct dlm_node *nd, const char *buf,
size_t len) size_t len)
{ {
nd->weight = simple_strtol(buf, NULL, 0); int rc = kstrtoint(buf, 0, &nd->weight);
if (rc)
return rc;
return len; return len;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment