summaryrefslogtreecommitdiff
path: root/mdadm.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2009-07-14 14:32:30 +1000
committerNeilBrown <neilb@suse.de>2009-07-14 14:32:30 +1000
commit5f4fc0e1916c47c1b172801f53362e50d32cd4dc (patch)
tree878345ba1b1b0b2679124a2f27880f8fa5a6edda /mdadm.c
parent19678e536d5b7aba8b721a3065f2550b79ddd208 (diff)
downloadmdadm-5f4fc0e1916c47c1b172801f53362e50d32cd4dc.tar.gz
Grow: --size improvements.
1/ allow --size to be given with 'G' or 'T' suffix. 2/ allow size to exceed 32bits, and in that case write through sysfs. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/mdadm.c b/mdadm.c
index 0432622..a77c4ad 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -389,12 +389,14 @@ int main(int argc, char *argv[])
if (strcmp(optarg, "max")==0)
size = 0;
else {
- size = strtoll(optarg, &c, 10);
- if (!optarg[0] || *c || size < 4) {
+ size = parse_size(optarg);
+ if (size < 8) {
fprintf(stderr, Name ": invalid size: %s\n",
optarg);
exit(2);
}
+ /* convert sectors to K */
+ size /= 2;
}
continue;