aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_super.c
diff options
context:
space:
mode:
authorAbhijit Pawar <abhi.c.pawar@gmail.com>2013-01-09 09:04:42 -0500
committerBen Myers <bpm@sgi.com>2013-01-13 15:42:07 -0500
commita17164e54bf0e3c2cbc72c35b9f67c2873a122dd (patch)
treed130e8e46c1ba9080563c91698d86b2735be93af /fs/xfs/xfs_super.c
parentd4608632ec8f4ae3ffecdd343ede34e60eabc64f (diff)
fs/xfs remove obsolete simple_strto<foo>
This patch replaces usages of obsolete simple_strtoul with kstrtoint in xfs_args and suffix_strtoul. Signed-off-by: Abhijit Pawar <abhi.c.pawar@gmail.com> Reviewed-by: Jie Liu <jeff.liu@oracle.com> Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_super.c')
-rw-r--r--fs/xfs/xfs_super.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c
index ab8839b26272..c407121873b4 100644
--- a/fs/xfs/xfs_super.c
+++ b/fs/xfs/xfs_super.c
@@ -139,9 +139,9 @@ static const match_table_t tokens = {
139 139
140 140
141STATIC unsigned long 141STATIC unsigned long
142suffix_strtoul(char *s, char **endp, unsigned int base) 142suffix_kstrtoint(char *s, unsigned int base, int *res)
143{ 143{
144 int last, shift_left_factor = 0; 144 int last, shift_left_factor = 0, _res;
145 char *value = s; 145 char *value = s;
146 146
147 last = strlen(value) - 1; 147 last = strlen(value) - 1;
@@ -158,7 +158,10 @@ suffix_strtoul(char *s, char **endp, unsigned int base)
158 value[last] = '\0'; 158 value[last] = '\0';
159 } 159 }
160 160
161 return simple_strtoul((const char *)s, endp, base) << shift_left_factor; 161 if (kstrtoint(s, base, &_res))
162 return -EINVAL;
163 *res = _res << shift_left_factor;
164 return 0;
162} 165}
163 166
164/* 167/*
@@ -174,7 +177,7 @@ xfs_parseargs(
174 char *options) 177 char *options)
175{ 178{
176 struct super_block *sb = mp->m_super; 179 struct super_block *sb = mp->m_super;
177 char *this_char, *value, *eov; 180 char *this_char, *value;
178 int dsunit = 0; 181 int dsunit = 0;
179 int dswidth = 0; 182 int dswidth = 0;
180 int iosize = 0; 183 int iosize = 0;
@@ -230,14 +233,16 @@ xfs_parseargs(
230 this_char); 233 this_char);
231 return EINVAL; 234 return EINVAL;
232 } 235 }
233 mp->m_logbufs = simple_strtoul(value, &eov, 10); 236 if (kstrtoint(value, 10, &mp->m_logbufs))
237 return EINVAL;
234 } else if (!strcmp(this_char, MNTOPT_LOGBSIZE)) { 238 } else if (!strcmp(this_char, MNTOPT_LOGBSIZE)) {
235 if (!value || !*value) { 239 if (!value || !*value) {
236 xfs_warn(mp, "%s option requires an argument", 240 xfs_warn(mp, "%s option requires an argument",
237 this_char); 241 this_char);
238 return EINVAL; 242 return EINVAL;
239 } 243 }
240 mp->m_logbsize = suffix_strtoul(value, &eov, 10); 244 if (suffix_kstrtoint(value, 10, &mp->m_logbsize))
245 return EINVAL;
241 } else if (!strcmp(this_char, MNTOPT_LOGDEV)) { 246 } else if (!strcmp(this_char, MNTOPT_LOGDEV)) {
242 if (!value || !*value) { 247 if (!value || !*value) {
243 xfs_warn(mp, "%s option requires an argument", 248 xfs_warn(mp, "%s option requires an argument",
@@ -266,7 +271,8 @@ xfs_parseargs(
266 this_char); 271 this_char);
267 return EINVAL; 272 return EINVAL;
268 } 273 }
269 iosize = simple_strtoul(value, &eov, 10); 274 if (kstrtoint(value, 10, &iosize))
275 return EINVAL;
270 iosizelog = ffs(iosize) - 1; 276 iosizelog = ffs(iosize) - 1;
271 } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE)) { 277 } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE)) {
272 if (!value || !*value) { 278 if (!value || !*value) {
@@ -274,7 +280,8 @@ xfs_parseargs(
274 this_char); 280 this_char);
275 return EINVAL; 281 return EINVAL;
276 } 282 }
277 iosize = suffix_strtoul(value, &eov, 10); 283 if (suffix_kstrtoint(value, 10, &iosize))
284 return EINVAL;
278 iosizelog = ffs(iosize) - 1; 285 iosizelog = ffs(iosize) - 1;
279 } else if (!strcmp(this_char, MNTOPT_GRPID) || 286 } else if (!strcmp(this_char, MNTOPT_GRPID) ||
280 !strcmp(this_char, MNTOPT_BSDGROUPS)) { 287 !strcmp(this_char, MNTOPT_BSDGROUPS)) {
@@ -296,14 +303,16 @@ xfs_parseargs(
296 this_char); 303 this_char);
297 return EINVAL; 304 return EINVAL;
298 } 305 }
299 dsunit = simple_strtoul(value, &eov, 10); 306 if (kstrtoint(value, 10, &dsunit))
307 return EINVAL;
300 } else if (!strcmp(this_char, MNTOPT_SWIDTH)) { 308 } else if (!strcmp(this_char, MNTOPT_SWIDTH)) {
301 if (!value || !*value) { 309 if (!value || !*value) {
302 xfs_warn(mp, "%s option requires an argument", 310 xfs_warn(mp, "%s option requires an argument",
303 this_char); 311 this_char);
304 return EINVAL; 312 return EINVAL;
305 } 313 }
306 dswidth = simple_strtoul(value, &eov, 10); 314 if (kstrtoint(value, 10, &dswidth))
315 return EINVAL;
307 } else if (!strcmp(this_char, MNTOPT_32BITINODE)) { 316 } else if (!strcmp(this_char, MNTOPT_32BITINODE)) {
308 mp->m_flags |= XFS_MOUNT_SMALL_INUMS; 317 mp->m_flags |= XFS_MOUNT_SMALL_INUMS;
309 } else if (!strcmp(this_char, MNTOPT_64BITINODE)) { 318 } else if (!strcmp(this_char, MNTOPT_64BITINODE)) {