diff options
author | NeilBrown <neilb@suse.de> | 2012-07-09 09:21:06 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-07-09 09:21:06 +0200 |
commit | a93f8c6540892d78ae8886d03434eb0a78175187 (patch) | |
tree | a4469c4f39cd3c3b78651ad468210685eb5f3a6d /mdadm.c | |
parent | Change the values for "max size" from -1 to 1. (diff) | |
download | mdadm-a93f8c6540892d78ae8886d03434eb0a78175187.tar.xz mdadm-a93f8c6540892d78ae8886d03434eb0a78175187.zip |
change array_size to be unsigned and use the new MAX_SIZE
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to '')
-rw-r--r-- | mdadm.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -50,7 +50,7 @@ int main(int argc, char *argv[]) int chunk = 0; unsigned long long size = 0; - long long array_size = -1; + unsigned long long array_size = 0; int level = UnSet; int layout = UnSet; char *layout_str = NULL; @@ -436,13 +436,13 @@ int main(int argc, char *argv[]) continue; case O(GROW,'Z'): /* array size */ - if (array_size >= 0) { + if (array_size > 0) { pr_err("array-size may only be specified once. " "Second value is %s.\n", optarg); exit(2); } if (strcmp(optarg, "max") == 0) - array_size = 0; + array_size = MAX_SIZE; else { array_size = parse_size(optarg); if (array_size <= 0) { @@ -1397,7 +1397,7 @@ int main(int argc, char *argv[]) break; case GROW: - if (array_size >= 0) { + if (array_size > 0) { /* alway impose array size first, independent of * anything else * Do not allow level or raid_disks changes at the @@ -1413,7 +1413,7 @@ int main(int argc, char *argv[]) break; } sysfs_init(&sra, mdfd, 0); - if (array_size == 0) + if (array_size == MAX_SIZE) err = sysfs_set_str(&sra, NULL, "array_size", "default"); else err = sysfs_set_num(&sra, NULL, "array_size", array_size / 2); @@ -1465,7 +1465,7 @@ int main(int argc, char *argv[]) size, level, layout_str, chunk, raiddisks, devlist->next, assume_clean, c.force); - } else if (array_size < 0) + } else if (array_size == 0) pr_err("no changes to --grow\n"); break; case INCREMENTAL: |