diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-06-01 03:15:16 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2013-06-13 18:10:26 -0400 |
commit | b29bebd66dbd492105668ec3515a5ffb0b25e4c1 (patch) | |
tree | 5cbb8054acd42c242ffd34413e293faab54a1d3f /drivers | |
parent | 90f5f7ad4f38d67626b0c220a0ac390603e0bded (diff) |
md: replace strict_strto*() with kstrto*()
The usage of strict_strtoul() is not preferred, because
strict_strtoul() is obsolete. Thus, kstrtoul() should be
used.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/bitmap.c | 8 | ||||
-rw-r--r-- | drivers/md/dm-raid.c | 8 | ||||
-rw-r--r-- | drivers/md/md.c | 16 | ||||
-rw-r--r-- | drivers/md/raid5.c | 4 |
4 files changed, 18 insertions, 18 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 5a2c75499824..a7fd82133b12 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -2002,9 +2002,9 @@ location_store(struct mddev *mddev, const char *buf, size_t len) | |||
2002 | } else { | 2002 | } else { |
2003 | int rv; | 2003 | int rv; |
2004 | if (buf[0] == '+') | 2004 | if (buf[0] == '+') |
2005 | rv = strict_strtoll(buf+1, 10, &offset); | 2005 | rv = kstrtoll(buf+1, 10, &offset); |
2006 | else | 2006 | else |
2007 | rv = strict_strtoll(buf, 10, &offset); | 2007 | rv = kstrtoll(buf, 10, &offset); |
2008 | if (rv) | 2008 | if (rv) |
2009 | return rv; | 2009 | return rv; |
2010 | if (offset == 0) | 2010 | if (offset == 0) |
@@ -2139,7 +2139,7 @@ static ssize_t | |||
2139 | backlog_store(struct mddev *mddev, const char *buf, size_t len) | 2139 | backlog_store(struct mddev *mddev, const char *buf, size_t len) |
2140 | { | 2140 | { |
2141 | unsigned long backlog; | 2141 | unsigned long backlog; |
2142 | int rv = strict_strtoul(buf, 10, &backlog); | 2142 | int rv = kstrtoul(buf, 10, &backlog); |
2143 | if (rv) | 2143 | if (rv) |
2144 | return rv; | 2144 | return rv; |
2145 | if (backlog > COUNTER_MAX) | 2145 | if (backlog > COUNTER_MAX) |
@@ -2165,7 +2165,7 @@ chunksize_store(struct mddev *mddev, const char *buf, size_t len) | |||
2165 | unsigned long csize; | 2165 | unsigned long csize; |
2166 | if (mddev->bitmap) | 2166 | if (mddev->bitmap) |
2167 | return -EBUSY; | 2167 | return -EBUSY; |
2168 | rv = strict_strtoul(buf, 10, &csize); | 2168 | rv = kstrtoul(buf, 10, &csize); |
2169 | if (rv) | 2169 | if (rv) |
2170 | return rv; | 2170 | return rv; |
2171 | if (csize < 512 || | 2171 | if (csize < 512 || |
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index 0f5a6fb5978f..21e8e4660c59 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c | |||
@@ -504,7 +504,7 @@ static int parse_raid_params(struct raid_set *rs, char **argv, | |||
504 | * First, parse the in-order required arguments | 504 | * First, parse the in-order required arguments |
505 | * "chunk_size" is the only argument of this type. | 505 | * "chunk_size" is the only argument of this type. |
506 | */ | 506 | */ |
507 | if ((strict_strtoul(argv[0], 10, &value) < 0)) { | 507 | if ((kstrtoul(argv[0], 10, &value) < 0)) { |
508 | rs->ti->error = "Bad chunk size"; | 508 | rs->ti->error = "Bad chunk size"; |
509 | return -EINVAL; | 509 | return -EINVAL; |
510 | } else if (rs->raid_type->level == 1) { | 510 | } else if (rs->raid_type->level == 1) { |
@@ -585,7 +585,7 @@ static int parse_raid_params(struct raid_set *rs, char **argv, | |||
585 | continue; | 585 | continue; |
586 | } | 586 | } |
587 | 587 | ||
588 | if (strict_strtoul(argv[i], 10, &value) < 0) { | 588 | if (kstrtoul(argv[i], 10, &value) < 0) { |
589 | rs->ti->error = "Bad numerical argument given in raid params"; | 589 | rs->ti->error = "Bad numerical argument given in raid params"; |
590 | return -EINVAL; | 590 | return -EINVAL; |
591 | } | 591 | } |
@@ -1181,7 +1181,7 @@ static int raid_ctr(struct dm_target *ti, unsigned argc, char **argv) | |||
1181 | argv++; | 1181 | argv++; |
1182 | 1182 | ||
1183 | /* number of RAID parameters */ | 1183 | /* number of RAID parameters */ |
1184 | if (strict_strtoul(argv[0], 10, &num_raid_params) < 0) { | 1184 | if (kstrtoul(argv[0], 10, &num_raid_params) < 0) { |
1185 | ti->error = "Cannot understand number of RAID parameters"; | 1185 | ti->error = "Cannot understand number of RAID parameters"; |
1186 | return -EINVAL; | 1186 | return -EINVAL; |
1187 | } | 1187 | } |
@@ -1194,7 +1194,7 @@ static int raid_ctr(struct dm_target *ti, unsigned argc, char **argv) | |||
1194 | return -EINVAL; | 1194 | return -EINVAL; |
1195 | } | 1195 | } |
1196 | 1196 | ||
1197 | if ((strict_strtoul(argv[num_raid_params], 10, &num_raid_devs) < 0) || | 1197 | if ((kstrtoul(argv[num_raid_params], 10, &num_raid_devs) < 0) || |
1198 | (num_raid_devs >= INT_MAX)) { | 1198 | (num_raid_devs >= INT_MAX)) { |
1199 | ti->error = "Cannot understand number of raid devices"; | 1199 | ti->error = "Cannot understand number of raid devices"; |
1200 | return -EINVAL; | 1200 | return -EINVAL; |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 3b25b72ef0b6..26f9452ea61c 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -2867,7 +2867,7 @@ static ssize_t | |||
2867 | offset_store(struct md_rdev *rdev, const char *buf, size_t len) | 2867 | offset_store(struct md_rdev *rdev, const char *buf, size_t len) |
2868 | { | 2868 | { |
2869 | unsigned long long offset; | 2869 | unsigned long long offset; |
2870 | if (strict_strtoull(buf, 10, &offset) < 0) | 2870 | if (kstrtoull(buf, 10, &offset) < 0) |
2871 | return -EINVAL; | 2871 | return -EINVAL; |
2872 | if (rdev->mddev->pers && rdev->raid_disk >= 0) | 2872 | if (rdev->mddev->pers && rdev->raid_disk >= 0) |
2873 | return -EBUSY; | 2873 | return -EBUSY; |
@@ -2895,7 +2895,7 @@ static ssize_t new_offset_store(struct md_rdev *rdev, | |||
2895 | unsigned long long new_offset; | 2895 | unsigned long long new_offset; |
2896 | struct mddev *mddev = rdev->mddev; | 2896 | struct mddev *mddev = rdev->mddev; |
2897 | 2897 | ||
2898 | if (strict_strtoull(buf, 10, &new_offset) < 0) | 2898 | if (kstrtoull(buf, 10, &new_offset) < 0) |
2899 | return -EINVAL; | 2899 | return -EINVAL; |
2900 | 2900 | ||
2901 | if (mddev->sync_thread) | 2901 | if (mddev->sync_thread) |
@@ -2961,7 +2961,7 @@ static int strict_blocks_to_sectors(const char *buf, sector_t *sectors) | |||
2961 | unsigned long long blocks; | 2961 | unsigned long long blocks; |
2962 | sector_t new; | 2962 | sector_t new; |
2963 | 2963 | ||
2964 | if (strict_strtoull(buf, 10, &blocks) < 0) | 2964 | if (kstrtoull(buf, 10, &blocks) < 0) |
2965 | return -EINVAL; | 2965 | return -EINVAL; |
2966 | 2966 | ||
2967 | if (blocks & 1ULL << (8 * sizeof(blocks) - 1)) | 2967 | if (blocks & 1ULL << (8 * sizeof(blocks) - 1)) |
@@ -3069,7 +3069,7 @@ static ssize_t recovery_start_store(struct md_rdev *rdev, const char *buf, size_ | |||
3069 | 3069 | ||
3070 | if (cmd_match(buf, "none")) | 3070 | if (cmd_match(buf, "none")) |
3071 | recovery_start = MaxSector; | 3071 | recovery_start = MaxSector; |
3072 | else if (strict_strtoull(buf, 10, &recovery_start)) | 3072 | else if (kstrtoull(buf, 10, &recovery_start)) |
3073 | return -EINVAL; | 3073 | return -EINVAL; |
3074 | 3074 | ||
3075 | if (rdev->mddev->pers && | 3075 | if (rdev->mddev->pers && |
@@ -3497,7 +3497,7 @@ level_store(struct mddev *mddev, const char *buf, size_t len) | |||
3497 | if (clevel[len-1] == '\n') | 3497 | if (clevel[len-1] == '\n') |
3498 | len--; | 3498 | len--; |
3499 | clevel[len] = 0; | 3499 | clevel[len] = 0; |
3500 | if (strict_strtol(clevel, 10, &level)) | 3500 | if (kstrtol(clevel, 10, &level)) |
3501 | level = LEVEL_NONE; | 3501 | level = LEVEL_NONE; |
3502 | 3502 | ||
3503 | if (request_module("md-%s", clevel) != 0) | 3503 | if (request_module("md-%s", clevel) != 0) |
@@ -4356,7 +4356,7 @@ sync_force_parallel_store(struct mddev *mddev, const char *buf, size_t len) | |||
4356 | { | 4356 | { |
4357 | long n; | 4357 | long n; |
4358 | 4358 | ||
4359 | if (strict_strtol(buf, 10, &n)) | 4359 | if (kstrtol(buf, 10, &n)) |
4360 | return -EINVAL; | 4360 | return -EINVAL; |
4361 | 4361 | ||
4362 | if (n != 0 && n != 1) | 4362 | if (n != 0 && n != 1) |
@@ -4424,7 +4424,7 @@ static ssize_t | |||
4424 | min_sync_store(struct mddev *mddev, const char *buf, size_t len) | 4424 | min_sync_store(struct mddev *mddev, const char *buf, size_t len) |
4425 | { | 4425 | { |
4426 | unsigned long long min; | 4426 | unsigned long long min; |
4427 | if (strict_strtoull(buf, 10, &min)) | 4427 | if (kstrtoull(buf, 10, &min)) |
4428 | return -EINVAL; | 4428 | return -EINVAL; |
4429 | if (min > mddev->resync_max) | 4429 | if (min > mddev->resync_max) |
4430 | return -EINVAL; | 4430 | return -EINVAL; |
@@ -4461,7 +4461,7 @@ max_sync_store(struct mddev *mddev, const char *buf, size_t len) | |||
4461 | mddev->resync_max = MaxSector; | 4461 | mddev->resync_max = MaxSector; |
4462 | else { | 4462 | else { |
4463 | unsigned long long max; | 4463 | unsigned long long max; |
4464 | if (strict_strtoull(buf, 10, &max)) | 4464 | if (kstrtoull(buf, 10, &max)) |
4465 | return -EINVAL; | 4465 | return -EINVAL; |
4466 | if (max < mddev->resync_min) | 4466 | if (max < mddev->resync_min) |
4467 | return -EINVAL; | 4467 | return -EINVAL; |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 05e4a105b9c7..cd9aab9329fd 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -4924,7 +4924,7 @@ raid5_store_stripe_cache_size(struct mddev *mddev, const char *page, size_t len) | |||
4924 | if (!conf) | 4924 | if (!conf) |
4925 | return -ENODEV; | 4925 | return -ENODEV; |
4926 | 4926 | ||
4927 | if (strict_strtoul(page, 10, &new)) | 4927 | if (kstrtoul(page, 10, &new)) |
4928 | return -EINVAL; | 4928 | return -EINVAL; |
4929 | err = raid5_set_cache_size(mddev, new); | 4929 | err = raid5_set_cache_size(mddev, new); |
4930 | if (err) | 4930 | if (err) |
@@ -4957,7 +4957,7 @@ raid5_store_preread_threshold(struct mddev *mddev, const char *page, size_t len) | |||
4957 | if (!conf) | 4957 | if (!conf) |
4958 | return -ENODEV; | 4958 | return -ENODEV; |
4959 | 4959 | ||
4960 | if (strict_strtoul(page, 10, &new)) | 4960 | if (kstrtoul(page, 10, &new)) |
4961 | return -EINVAL; | 4961 | return -EINVAL; |
4962 | if (new > conf->max_nr_stripes) | 4962 | if (new > conf->max_nr_stripes) |
4963 | return -EINVAL; | 4963 | return -EINVAL; |