diff options
author | NeilBrown <neilb@suse.de> | 2012-08-01 06:40:02 -0400 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-08-01 06:40:02 -0400 |
commit | bb181e2e48f8c85db08c9cb015cbba9618dbf05c (patch) | |
tree | 191bc24dd97bcb174535cc217af082f16da3b43d /drivers/md/dm-exception-store.c | |
parent | d57368afe63b3b7b45ce6c2b8c5276417935be2f (diff) | |
parent | c039c332f23e794deb6d6f37b9f07ff3b27fb2cf (diff) |
Merge commit 'c039c332f23e794deb6d6f37b9f07ff3b27fb2cf' into md
Pull in pre-requisites for adding raid10 support to dm-raid.
Diffstat (limited to 'drivers/md/dm-exception-store.c')
-rw-r--r-- | drivers/md/dm-exception-store.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c index aa70f7d43a1a..ebaa4f803eec 100644 --- a/drivers/md/dm-exception-store.c +++ b/drivers/md/dm-exception-store.c | |||
@@ -142,24 +142,19 @@ EXPORT_SYMBOL(dm_exception_store_type_unregister); | |||
142 | static int set_chunk_size(struct dm_exception_store *store, | 142 | static int set_chunk_size(struct dm_exception_store *store, |
143 | const char *chunk_size_arg, char **error) | 143 | const char *chunk_size_arg, char **error) |
144 | { | 144 | { |
145 | unsigned long chunk_size_ulong; | 145 | unsigned chunk_size; |
146 | char *value; | ||
147 | 146 | ||
148 | chunk_size_ulong = simple_strtoul(chunk_size_arg, &value, 10); | 147 | if (kstrtouint(chunk_size_arg, 10, &chunk_size)) { |
149 | if (*chunk_size_arg == '\0' || *value != '\0' || | ||
150 | chunk_size_ulong > UINT_MAX) { | ||
151 | *error = "Invalid chunk size"; | 148 | *error = "Invalid chunk size"; |
152 | return -EINVAL; | 149 | return -EINVAL; |
153 | } | 150 | } |
154 | 151 | ||
155 | if (!chunk_size_ulong) { | 152 | if (!chunk_size) { |
156 | store->chunk_size = store->chunk_mask = store->chunk_shift = 0; | 153 | store->chunk_size = store->chunk_mask = store->chunk_shift = 0; |
157 | return 0; | 154 | return 0; |
158 | } | 155 | } |
159 | 156 | ||
160 | return dm_exception_store_set_chunk_size(store, | 157 | return dm_exception_store_set_chunk_size(store, chunk_size, error); |
161 | (unsigned) chunk_size_ulong, | ||
162 | error); | ||
163 | } | 158 | } |
164 | 159 | ||
165 | int dm_exception_store_set_chunk_size(struct dm_exception_store *store, | 160 | int dm_exception_store_set_chunk_size(struct dm_exception_store *store, |