diff options
author | Fabian Frederick <fabf@skynet.be> | 2014-06-06 17:38:24 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-06 19:08:17 -0400 |
commit | 4f4c337fb7fb946824a26e78e37b85ef25e0a4a2 (patch) | |
tree | af09618e4374a1c21552e9952c4c8d1fa984beb6 /fs/dlm | |
parent | 33041a0d76d3c3e0aff28ac95a2ffdedf1282dbc (diff) |
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: Fabian Frederick <fabf@skynet.be>
Cc: Christine Caulfield <ccaulfie@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/dlm')
-rw-r--r-- | fs/dlm/config.c | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/fs/dlm/config.c b/fs/dlm/config.c index 76feb4b60fa6..d521bddf876d 100644 --- a/fs/dlm/config.c +++ b/fs/dlm/config.c | |||
@@ -157,11 +157,13 @@ static ssize_t cluster_set(struct dlm_cluster *cl, unsigned int *cl_field, | |||
157 | const char *buf, size_t len) | 157 | const char *buf, size_t len) |
158 | { | 158 | { |
159 | unsigned int x; | 159 | unsigned int x; |
160 | int rc; | ||
160 | 161 | ||
161 | if (!capable(CAP_SYS_ADMIN)) | 162 | if (!capable(CAP_SYS_ADMIN)) |
162 | return -EPERM; | 163 | return -EPERM; |
163 | 164 | rc = kstrtouint(buf, 0, &x); | |
164 | x = simple_strtoul(buf, NULL, 0); | 165 | if (rc) |
166 | return rc; | ||
165 | 167 | ||
166 | if (check_zero && !x) | 168 | if (check_zero && !x) |
167 | return -EINVAL; | 169 | return -EINVAL; |
@@ -730,7 +732,10 @@ static ssize_t comm_nodeid_read(struct dlm_comm *cm, char *buf) | |||
730 | static ssize_t comm_nodeid_write(struct dlm_comm *cm, const char *buf, | 732 | static ssize_t comm_nodeid_write(struct dlm_comm *cm, const char *buf, |
731 | size_t len) | 733 | size_t len) |
732 | { | 734 | { |
733 | cm->nodeid = simple_strtol(buf, NULL, 0); | 735 | int rc = kstrtoint(buf, 0, &cm->nodeid); |
736 | |||
737 | if (rc) | ||
738 | return rc; | ||
734 | return len; | 739 | return len; |
735 | } | 740 | } |
736 | 741 | ||
@@ -742,7 +747,10 @@ static ssize_t comm_local_read(struct dlm_comm *cm, char *buf) | |||
742 | static ssize_t comm_local_write(struct dlm_comm *cm, const char *buf, | 747 | static ssize_t comm_local_write(struct dlm_comm *cm, const char *buf, |
743 | size_t len) | 748 | size_t len) |
744 | { | 749 | { |
745 | cm->local= simple_strtol(buf, NULL, 0); | 750 | int rc = kstrtoint(buf, 0, &cm->local); |
751 | |||
752 | if (rc) | ||
753 | return rc; | ||
746 | if (cm->local && !local_comm) | 754 | if (cm->local && !local_comm) |
747 | local_comm = cm; | 755 | local_comm = cm; |
748 | return len; | 756 | return len; |
@@ -846,7 +854,10 @@ static ssize_t node_nodeid_write(struct dlm_node *nd, const char *buf, | |||
846 | size_t len) | 854 | size_t len) |
847 | { | 855 | { |
848 | uint32_t seq = 0; | 856 | uint32_t seq = 0; |
849 | nd->nodeid = simple_strtol(buf, NULL, 0); | 857 | int rc = kstrtoint(buf, 0, &nd->nodeid); |
858 | |||
859 | if (rc) | ||
860 | return rc; | ||
850 | dlm_comm_seq(nd->nodeid, &seq); | 861 | dlm_comm_seq(nd->nodeid, &seq); |
851 | nd->comm_seq = seq; | 862 | nd->comm_seq = seq; |
852 | return len; | 863 | return len; |
@@ -860,7 +871,10 @@ static ssize_t node_weight_read(struct dlm_node *nd, char *buf) | |||
860 | static ssize_t node_weight_write(struct dlm_node *nd, const char *buf, | 871 | static ssize_t node_weight_write(struct dlm_node *nd, const char *buf, |
861 | size_t len) | 872 | size_t len) |
862 | { | 873 | { |
863 | nd->weight = simple_strtol(buf, NULL, 0); | 874 | int rc = kstrtoint(buf, 0, &nd->weight); |
875 | |||
876 | if (rc) | ||
877 | return rc; | ||
864 | return len; | 878 | return len; |
865 | } | 879 | } |
866 | 880 | ||