summaryrefslogtreecommitdiff
path: root/Manage.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2010-11-22 19:35:25 +1100
committerNeilBrown <neilb@suse.de>2010-11-22 19:35:25 +1100
commit4725bc31fb3d7fc207671e851617852dc8034cd5 (patch)
treea79c3c1d0565aaaab0658c95e8033ed23072c4a4 /Manage.c
parentfeab51f8f710f28a63a5b01ec59a5a609a45525b (diff)
super_by_fd: return subarray info explicitly.
Rather than hiding this in the 'st', return it explicitly. In the one case we still need it, copy it into st where needed. This will disappear in a future patch. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'Manage.c')
-rw-r--r--Manage.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Manage.c b/Manage.c
index c3322f4d..1ce4aa63 100644
--- a/Manage.c
+++ b/Manage.c
@@ -349,6 +349,7 @@ int Manage_subdevs(char *devname, int fd,
int j, jnext = 0;
int tfd = -1;
struct supertype *st, *tst;
+ char *subarray = NULL;
int duuid[4];
int ouuid[4];
int lfd = -1;
@@ -369,7 +370,7 @@ int Manage_subdevs(char *devname, int fd,
if (array_size <= 0)
array_size = array.size * 2;
- tst = super_by_fd(fd);
+ tst = super_by_fd(fd, &subarray);
if (!tst) {
fprintf(stderr, Name ": unsupport array - version %d.%d\n",
array.major_version, array.minor_version);
@@ -548,7 +549,7 @@ int Manage_subdevs(char *devname, int fd,
return 1;
case 'a':
/* add the device */
- if (tst->subarray[0]) {
+ if (subarray) {
fprintf(stderr, Name ": Cannot add disks to a"
" \'member\' array, perform this"
" operation on the parent container\n");
@@ -879,7 +880,7 @@ int Manage_subdevs(char *devname, int fd,
case 'r':
/* hot remove */
- if (tst->subarray[0]) {
+ if (subarray) {
fprintf(stderr, Name ": Cannot remove disks from a"
" \'member\' array, perform this"
" operation on the parent container\n");