summaryrefslogtreecommitdiffstats
path: root/managemon.c
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2008-07-12 20:27:40 +1000
committerNeil Brown <neilb@suse.de>2008-07-12 20:27:40 +1000
commitedd8d13c0247b8df5876a94c2d61d74d2cf62c7e (patch)
tree77b53caceb67a989f19811044ce15a61a76bcd28 /managemon.c
parentbfa44e2e7afb88a9f2d6083f8ff31c2d50cc78dc (diff)
downloadmdadm-edd8d13c0247b8df5876a94c2d61d74d2cf62c7e.tar.gz
mdadm-edd8d13c0247b8df5876a94c2d61d74d2cf62c7e.tar.xz
mdadm-edd8d13c0247b8df5876a94c2d61d74d2cf62c7e.zip
Create arrays via metadata-update
Support creating arrays inside an active ddf container by sending a metadata update over a pipe to mdmon.
Diffstat (limited to 'managemon.c')
-rw-r--r--managemon.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/managemon.c b/managemon.c
index 1917218..03de9a8 100644
--- a/managemon.c
+++ b/managemon.c
@@ -428,9 +428,25 @@ void manage(struct mdstat_ent *mdstat, struct supertype *container)
}
}
-static int handle_message(struct supertype *container, struct metadata_update *msg)
+static void handle_message(struct supertype *container, struct metadata_update *msg)
{
- return -1;
+ /* queue this metadata update through to the monitor */
+
+ struct metadata_update *mu;
+
+ if (msg->len == 0) {
+ wait_update_handled();
+ } else {
+ mu = malloc(sizeof(*mu));
+ mu->len = msg->len;
+ mu->buf = msg->buf;
+ msg->buf = NULL;
+ mu->space = NULL;
+ mu->next = NULL;
+ if (container->ss->prepare_update)
+ container->ss->prepare_update(container, mu);
+ queue_metadata_update(mu);
+ }
}
void read_sock(struct supertype *container)
@@ -460,8 +476,6 @@ void read_sock(struct supertype *container)
} else
terminate = 1;
- if (msg.buf)
- free(msg.buf);
} while (!terminate);
close(fd);