diff options
author | Neil Brown <neilb@suse.de> | 2008-07-12 12:27:40 +0200 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2008-07-12 12:27:40 +0200 |
commit | edd8d13c0247b8df5876a94c2d61d74d2cf62c7e (patch) | |
tree | 77b53caceb67a989f19811044ce15a61a76bcd28 /managemon.c | |
parent | Revise message passing code. (diff) | |
download | 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.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/managemon.c b/managemon.c index 19172182..03de9a89 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); |