search for: do_mdadm_stop

Displaying 1 result from an estimated 1 matches for "do_mdadm_stop".

2011 Nov 23
2
[PATCH] New API: mdadm-stop for stopping MD devices.
...ns/test-mdadm.sh | 14 ++++++++++++++ src/MAX_PROC_NR | 2 +- 4 files changed, 40 insertions(+), 1 deletions(-) diff --git a/daemon/md.c b/daemon/md.c index 82ddb82..9004a6f 100644 --- a/daemon/md.c +++ b/daemon/md.c @@ -310,3 +310,19 @@ error: return NULL; } + +int +do_mdadm_stop(const char *md) +{ + int r; + char *err = NULL; + + const char *mdadm[] = { "mdadm", "--stop", md, NULL}; + r = commandv(NULL, &err, mdadm); + if (r == -1) { + reply_with_error("%s", err); + free(err); + return -1; + } + return 0; +} diff --git a/ge...