g_raid3_ctl.c revision 133808
1133808Spjd/*-
2133808Spjd * Copyright (c) 2004 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3133808Spjd * All rights reserved.
4133808Spjd *
5133808Spjd * Redistribution and use in source and binary forms, with or without
6133808Spjd * modification, are permitted provided that the following conditions
7133808Spjd * are met:
8133808Spjd * 1. Redistributions of source code must retain the above copyright
9133808Spjd *    notice, this list of conditions and the following disclaimer.
10133808Spjd * 2. Redistributions in binary form must reproduce the above copyright
11133808Spjd *    notice, this list of conditions and the following disclaimer in the
12133808Spjd *    documentation and/or other materials provided with the distribution.
13133808Spjd *
14133808Spjd * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
15133808Spjd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16133808Spjd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17133808Spjd * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
18133808Spjd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19133808Spjd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20133808Spjd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21133808Spjd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22133808Spjd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23133808Spjd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24133808Spjd * SUCH DAMAGE.
25133808Spjd */
26133808Spjd
27133808Spjd#include <sys/cdefs.h>
28133808Spjd__FBSDID("$FreeBSD: head/sys/geom/raid3/g_raid3_ctl.c 133808 2004-08-16 06:23:14Z pjd $");
29133808Spjd
30133808Spjd#include <sys/param.h>
31133808Spjd#include <sys/systm.h>
32133808Spjd#include <sys/kernel.h>
33133808Spjd#include <sys/module.h>
34133808Spjd#include <sys/lock.h>
35133808Spjd#include <sys/mutex.h>
36133808Spjd#include <sys/bio.h>
37133808Spjd#include <sys/sysctl.h>
38133808Spjd#include <sys/malloc.h>
39133808Spjd#include <sys/bitstring.h>
40133808Spjd#include <vm/uma.h>
41133808Spjd#include <machine/atomic.h>
42133808Spjd#include <geom/geom.h>
43133808Spjd#include <sys/proc.h>
44133808Spjd#include <sys/kthread.h>
45133808Spjd#include <geom/raid3/g_raid3.h>
46133808Spjd
47133808Spjd
48133808Spjdstatic struct g_raid3_softc *
49133808Spjdg_raid3_find_device(struct g_class *mp, const char *name)
50133808Spjd{
51133808Spjd	struct g_raid3_softc *sc;
52133808Spjd	struct g_geom *gp;
53133808Spjd
54133808Spjd	g_topology_assert();
55133808Spjd	LIST_FOREACH(gp, &mp->geom, geom) {
56133808Spjd		sc = gp->softc;
57133808Spjd		if (sc == NULL)
58133808Spjd			continue;
59133808Spjd		if ((sc->sc_flags & G_RAID3_DEVICE_FLAG_DESTROY) != 0)
60133808Spjd			continue;
61133808Spjd		if (strcmp(gp->name, name) == 0 ||
62133808Spjd		    strcmp(sc->sc_name, name) == 0) {
63133808Spjd			return (sc);
64133808Spjd		}
65133808Spjd	}
66133808Spjd	return (NULL);
67133808Spjd}
68133808Spjd
69133808Spjdstatic struct g_raid3_disk *
70133808Spjdg_raid3_find_disk(struct g_raid3_softc *sc, const char *name)
71133808Spjd{
72133808Spjd	struct g_raid3_disk *disk;
73133808Spjd	u_int n;
74133808Spjd
75133808Spjd	g_topology_assert();
76133808Spjd	for (n = 0; n < sc->sc_ndisks; n++) {
77133808Spjd		disk = &sc->sc_disks[n];
78133808Spjd		if (disk->d_state == G_RAID3_DISK_STATE_NODISK)
79133808Spjd			continue;
80133808Spjd		if (disk->d_consumer == NULL)
81133808Spjd			continue;
82133808Spjd		if (disk->d_consumer->provider == NULL)
83133808Spjd			continue;
84133808Spjd		if (strcmp(disk->d_consumer->provider->name, name) == 0)
85133808Spjd			return (disk);
86133808Spjd	}
87133808Spjd	return (NULL);
88133808Spjd}
89133808Spjd
90133808Spjdstatic void
91133808Spjdg_raid3_ctl_configure(struct gctl_req *req, struct g_class *mp)
92133808Spjd{
93133808Spjd	struct g_raid3_softc *sc;
94133808Spjd	struct g_raid3_disk *disk;
95133808Spjd	const char *name;
96133808Spjd	int *nargs, *autosync, *noautosync, do_sync = 0;
97133808Spjd	u_int n;
98133808Spjd
99133808Spjd	g_topology_assert();
100133808Spjd	nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs));
101133808Spjd	if (*nargs != 1) {
102133808Spjd		gctl_error(req, "Invalid number of arguments.");
103133808Spjd		return;
104133808Spjd	}
105133808Spjd	name = gctl_get_asciiparam(req, "arg0");
106133808Spjd	sc = g_raid3_find_device(mp, name);
107133808Spjd	if (sc == NULL) {
108133808Spjd		gctl_error(req, "No such device: %s.", name);
109133808Spjd		return;
110133808Spjd	}
111133808Spjd	if (g_raid3_ndisks(sc, -1) < sc->sc_ndisks) {
112133808Spjd		gctl_error(req, "Not all disks connected.");
113133808Spjd		return;
114133808Spjd	}
115133808Spjd	autosync = gctl_get_paraml(req, "autosync", sizeof(*autosync));
116133808Spjd	if (autosync == NULL) {
117133808Spjd		gctl_error(req, "No '%s' argument.", "autosync");
118133808Spjd		return;
119133808Spjd	}
120133808Spjd	noautosync = gctl_get_paraml(req, "noautosync", sizeof(*noautosync));
121133808Spjd	if (noautosync == NULL) {
122133808Spjd		gctl_error(req, "No '%s' argument.", "noautosync");
123133808Spjd		return;
124133808Spjd	}
125133808Spjd	if (!*autosync && !*noautosync) {
126133808Spjd		gctl_error(req, "Nothing has changed.");
127133808Spjd		return;
128133808Spjd	}
129133808Spjd	if (*autosync && *noautosync) {
130133808Spjd		gctl_error(req, "'%s' and '%s' specified.", "autosync",
131133808Spjd		    "noautosync");
132133808Spjd		return;
133133808Spjd	}
134133808Spjd	if ((sc->sc_flags & G_RAID3_DEVICE_FLAG_NOAUTOSYNC) != 0) {
135133808Spjd		if (*autosync) {
136133808Spjd			sc->sc_flags &= ~G_RAID3_DEVICE_FLAG_NOAUTOSYNC;
137133808Spjd			do_sync = 1;
138133808Spjd		}
139133808Spjd	} else {
140133808Spjd		if (*noautosync)
141133808Spjd			sc->sc_flags |= G_RAID3_DEVICE_FLAG_NOAUTOSYNC;
142133808Spjd	}
143133808Spjd	for (n = 0; n < sc->sc_ndisks; n++) {
144133808Spjd		disk = &sc->sc_disks[n];
145133808Spjd		if (do_sync) {
146133808Spjd			if (disk->d_state == G_RAID3_DISK_STATE_SYNCHRONIZING)
147133808Spjd				disk->d_flags &= ~G_RAID3_DISK_FLAG_FORCE_SYNC;
148133808Spjd		}
149133808Spjd		g_raid3_update_metadata(disk);
150133808Spjd		if (do_sync) {
151133808Spjd			if (disk->d_state == G_RAID3_DISK_STATE_STALE) {
152133808Spjd				/*
153133808Spjd				 * XXX: This is probably possible that this
154133808Spjd				 *      component will not be retasted.
155133808Spjd				 */
156133808Spjd				g_raid3_event_send(disk,
157133808Spjd				    G_RAID3_DISK_STATE_DISCONNECTED,
158133808Spjd				    G_RAID3_EVENT_DONTWAIT);
159133808Spjd			}
160133808Spjd		}
161133808Spjd	}
162133808Spjd}
163133808Spjd
164133808Spjdstatic void
165133808Spjdg_raid3_ctl_rebuild(struct gctl_req *req, struct g_class *mp)
166133808Spjd{
167133808Spjd	struct g_raid3_softc *sc;
168133808Spjd	struct g_raid3_disk *disk;
169133808Spjd	const char *name;
170133808Spjd	int *nargs;
171133808Spjd
172133808Spjd	g_topology_assert();
173133808Spjd	nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs));
174133808Spjd	if (nargs == NULL) {
175133808Spjd		gctl_error(req, "No '%s' argument.", "nargs");
176133808Spjd		return;
177133808Spjd	}
178133808Spjd	if (*nargs != 2) {
179133808Spjd		gctl_error(req, "Invalid number of arguments.");
180133808Spjd		return;
181133808Spjd	}
182133808Spjd	name = gctl_get_asciiparam(req, "arg0");
183133808Spjd	if (name == NULL) {
184133808Spjd		gctl_error(req, "No 'arg%u' argument.", 0);
185133808Spjd		return;
186133808Spjd	}
187133808Spjd	sc = g_raid3_find_device(mp, name);
188133808Spjd	if (sc == NULL) {
189133808Spjd		gctl_error(req, "No such device: %s.", name);
190133808Spjd		return;
191133808Spjd	}
192133808Spjd	name = gctl_get_asciiparam(req, "arg1");
193133808Spjd	if (name == NULL) {
194133808Spjd		gctl_error(req, "No 'arg%u' argument.", 1);
195133808Spjd		return;
196133808Spjd	}
197133808Spjd	disk = g_raid3_find_disk(sc, name);
198133808Spjd	if (disk == NULL) {
199133808Spjd		gctl_error(req, "No such provider: %s.", name);
200133808Spjd		return;
201133808Spjd	}
202133808Spjd	if (disk->d_state == G_RAID3_DISK_STATE_ACTIVE &&
203133808Spjd	    g_raid3_ndisks(sc, G_RAID3_DISK_STATE_ACTIVE) < sc->sc_ndisks) {
204133808Spjd		gctl_error(req, "There is one stale disk already.", name);
205133808Spjd		return;
206133808Spjd	}
207133808Spjd	/*
208133808Spjd	 * Do rebuild by resetting syncid and disconnecting disk.
209133808Spjd	 * It'll be retasted, connected to the device and synchronized.
210133808Spjd	 */
211133808Spjd	disk->d_sync.ds_syncid = 0;
212133808Spjd	if ((sc->sc_flags & G_RAID3_DEVICE_FLAG_NOAUTOSYNC) != 0)
213133808Spjd		disk->d_flags |= G_RAID3_DISK_FLAG_FORCE_SYNC;
214133808Spjd	g_raid3_update_metadata(disk);
215133808Spjd	g_raid3_event_send(disk, G_RAID3_DISK_STATE_DISCONNECTED,
216133808Spjd	    G_RAID3_EVENT_WAIT);
217133808Spjd}
218133808Spjd
219133808Spjdstatic void
220133808Spjdg_raid3_ctl_stop(struct gctl_req *req, struct g_class *mp)
221133808Spjd{
222133808Spjd	struct g_raid3_softc *sc;
223133808Spjd	int *force, *nargs, error;
224133808Spjd	const char *name;
225133808Spjd	char param[16];
226133808Spjd	u_int i;
227133808Spjd
228133808Spjd	g_topology_assert();
229133808Spjd
230133808Spjd	nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs));
231133808Spjd	if (nargs == NULL) {
232133808Spjd		gctl_error(req, "No '%s' argument.", "nargs");
233133808Spjd		return;
234133808Spjd	}
235133808Spjd	if (*nargs < 1) {
236133808Spjd		gctl_error(req, "Missing device(s).");
237133808Spjd		return;
238133808Spjd	}
239133808Spjd	force = gctl_get_paraml(req, "force", sizeof(*force));
240133808Spjd	if (force == NULL) {
241133808Spjd		gctl_error(req, "No '%s' argument.", "force");
242133808Spjd		return;
243133808Spjd	}
244133808Spjd
245133808Spjd	for (i = 0; i < (u_int)*nargs; i++) {
246133808Spjd		snprintf(param, sizeof(param), "arg%u", i);
247133808Spjd		name = gctl_get_asciiparam(req, param);
248133808Spjd		if (name == NULL) {
249133808Spjd			gctl_error(req, "No 'arg%u' argument.", i);
250133808Spjd			return;
251133808Spjd		}
252133808Spjd		sc = g_raid3_find_device(mp, name);
253133808Spjd		if (sc == NULL) {
254133808Spjd			gctl_error(req, "No such device: %s.", name);
255133808Spjd			return;
256133808Spjd		}
257133808Spjd		error = g_raid3_destroy(sc, *force);
258133808Spjd		if (error != 0) {
259133808Spjd			gctl_error(req, "Cannot destroy device %s (error=%d).",
260133808Spjd			    sc->sc_geom->name, error);
261133808Spjd			return;
262133808Spjd		}
263133808Spjd	}
264133808Spjd}
265133808Spjd
266133808Spjdstatic void
267133808Spjdg_raid3_ctl_insert_orphan(struct g_consumer *cp)
268133808Spjd{
269133808Spjd
270133808Spjd	KASSERT(1 == 0, ("%s called while inserting %s.", __func__,
271133808Spjd	    cp->provider->name));
272133808Spjd}
273133808Spjd
274133808Spjdstatic void
275133808Spjdg_raid3_ctl_insert(struct gctl_req *req, struct g_class *mp)
276133808Spjd{
277133808Spjd	struct g_raid3_metadata md;
278133808Spjd	struct g_raid3_softc *sc;
279133808Spjd	struct g_raid3_disk *disk;
280133808Spjd	struct g_geom *gp;
281133808Spjd	struct g_provider *pp;
282133808Spjd	struct g_consumer *cp;
283133808Spjd	const char *name;
284133808Spjd	u_char *sector;
285133808Spjd	intmax_t *no;
286133808Spjd	int *hardcode, *nargs, error;
287133808Spjd
288133808Spjd	g_topology_assert();
289133808Spjd	nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs));
290133808Spjd	if (nargs == NULL) {
291133808Spjd		gctl_error(req, "No '%s' argument.", "nargs");
292133808Spjd		return;
293133808Spjd	}
294133808Spjd	if (*nargs != 2) {
295133808Spjd		gctl_error(req, "Invalid number of arguments.");
296133808Spjd		return;
297133808Spjd	}
298133808Spjd	name = gctl_get_asciiparam(req, "arg0");
299133808Spjd	if (name == NULL) {
300133808Spjd		gctl_error(req, "No 'arg%u' argument.", 0);
301133808Spjd		return;
302133808Spjd	}
303133808Spjd	sc = g_raid3_find_device(mp, name);
304133808Spjd	if (sc == NULL) {
305133808Spjd		gctl_error(req, "No such device: %s.", name);
306133808Spjd		return;
307133808Spjd	}
308133808Spjd	no = gctl_get_paraml(req, "number", sizeof(*no));
309133808Spjd	if (no == NULL) {
310133808Spjd		gctl_error(req, "No '%s' argument.", "no");
311133808Spjd		return;
312133808Spjd	}
313133808Spjd	if (*no >= sc->sc_ndisks) {
314133808Spjd		gctl_error(req, "Invalid component number.");
315133808Spjd		return;
316133808Spjd	}
317133808Spjd	hardcode = gctl_get_paraml(req, "hardcode", sizeof(*hardcode));
318133808Spjd	if (hardcode == NULL) {
319133808Spjd		gctl_error(req, "No '%s' argument.", "hardcode");
320133808Spjd		return;
321133808Spjd	}
322133808Spjd	disk = &sc->sc_disks[*no];
323133808Spjd	if (disk->d_state != G_RAID3_DISK_STATE_NODISK) {
324133808Spjd		gctl_error(req, "Component %u is already connected.", *no);
325133808Spjd		return;
326133808Spjd	}
327133808Spjd	name = gctl_get_asciiparam(req, "arg1");
328133808Spjd	if (name == NULL) {
329133808Spjd		gctl_error(req, "No 'arg%u' argument.", 1);
330133808Spjd		return;
331133808Spjd	}
332133808Spjd	pp = g_provider_by_name(name);
333133808Spjd	if (pp == NULL) {
334133808Spjd		gctl_error(req, "Invalid provider.");
335133808Spjd		return;
336133808Spjd	}
337133808Spjd	if (((sc->sc_sectorsize / (sc->sc_ndisks - 1)) % pp->sectorsize) != 0) {
338133808Spjd		gctl_error(req,
339133808Spjd		    "Cannot insert provider %s, because of its sector size.",
340133808Spjd		    pp->name);
341133808Spjd		return;
342133808Spjd	}
343133808Spjd	gp = g_new_geomf(mp, "raid3:insert");
344133808Spjd	gp->orphan = g_raid3_ctl_insert_orphan;
345133808Spjd	cp = g_new_consumer(gp);
346133808Spjd	error = g_attach(cp, pp);
347133808Spjd	if (error != 0) {
348133808Spjd		gctl_error(req, "Cannot attach to %s.", pp->name);
349133808Spjd		goto end;
350133808Spjd	}
351133808Spjd	error = g_access(cp, 0, 1, 1);
352133808Spjd	if (error != 0) {
353133808Spjd		gctl_error(req, "Cannot access %s.", pp->name);
354133808Spjd		goto end;
355133808Spjd	}
356133808Spjd	g_raid3_fill_metadata(disk, &md);
357133808Spjd	md.md_syncid = 0;
358133808Spjd        md.md_dflags = 0;
359133808Spjd	if (*hardcode)
360133808Spjd                strlcpy(md.md_provider, pp->name, sizeof(md.md_provider));
361133808Spjd        else
362133808Spjd                bzero(md.md_provider, sizeof(md.md_provider));
363133808Spjd	sector = g_malloc(pp->sectorsize, M_WAITOK);
364133808Spjd	raid3_metadata_encode(&md, sector);
365133808Spjd	g_topology_unlock();
366133808Spjd	error = g_write_data(cp, pp->mediasize - pp->sectorsize, sector,
367133808Spjd	    pp->sectorsize);
368133808Spjd	g_topology_lock();
369133808Spjd	g_free(sector);
370133808Spjd	if (error != 0)
371133808Spjd		gctl_error(req, "Cannot store metadata on %s.", pp->name);
372133808Spjdend:
373133808Spjd	if (gp != NULL) {
374133808Spjd		if (cp != NULL) {
375133808Spjd			if (cp->acw > 0)
376133808Spjd				g_access(cp, 0, -1, -1);
377133808Spjd			if (cp->provider != NULL)
378133808Spjd				g_detach(cp);
379133808Spjd			g_destroy_consumer(cp);
380133808Spjd		}
381133808Spjd		g_destroy_geom(gp);
382133808Spjd	}
383133808Spjd}
384133808Spjd
385133808Spjdstatic void
386133808Spjdg_raid3_ctl_remove(struct gctl_req *req, struct g_class *mp)
387133808Spjd{
388133808Spjd	struct g_raid3_softc *sc;
389133808Spjd	struct g_raid3_disk *disk;
390133808Spjd	const char *name;
391133808Spjd	intmax_t *no;
392133808Spjd	int *nargs;
393133808Spjd
394133808Spjd	g_topology_assert();
395133808Spjd	nargs = gctl_get_paraml(req, "nargs", sizeof(*nargs));
396133808Spjd	if (nargs == NULL) {
397133808Spjd		gctl_error(req, "No '%s' argument.", "nargs");
398133808Spjd		return;
399133808Spjd	}
400133808Spjd	if (*nargs != 1) {
401133808Spjd		gctl_error(req, "Invalid number of arguments.");
402133808Spjd		return;
403133808Spjd	}
404133808Spjd	name = gctl_get_asciiparam(req, "arg0");
405133808Spjd	if (name == NULL) {
406133808Spjd		gctl_error(req, "No 'arg%u' argument.", 0);
407133808Spjd		return;
408133808Spjd	}
409133808Spjd	sc = g_raid3_find_device(mp, name);
410133808Spjd	if (sc == NULL) {
411133808Spjd		gctl_error(req, "No such device: %s.", name);
412133808Spjd		return;
413133808Spjd	}
414133808Spjd	no = gctl_get_paraml(req, "number", sizeof(*no));
415133808Spjd	if (no == NULL) {
416133808Spjd		gctl_error(req, "No '%s' argument.", "no");
417133808Spjd		return;
418133808Spjd	}
419133808Spjd	if (*no >= sc->sc_ndisks) {
420133808Spjd		gctl_error(req, "Invalid component number.");
421133808Spjd		return;
422133808Spjd	}
423133808Spjd	disk = &sc->sc_disks[*no];
424133808Spjd	switch (disk->d_state) {
425133808Spjd	case G_RAID3_DISK_STATE_ACTIVE:
426133808Spjd		/*
427133808Spjd		 * When replacing ACTIVE component, all the rest has to be also
428133808Spjd		 * ACTIVE.
429133808Spjd		 */
430133808Spjd		if (g_raid3_ndisks(sc, G_RAID3_DISK_STATE_ACTIVE) <
431133808Spjd		    sc->sc_ndisks) {
432133808Spjd			gctl_error(req, "Cannot replace component number %u.",
433133808Spjd			    *no);
434133808Spjd			return;
435133808Spjd		}
436133808Spjd		/* FALLTHROUGH */
437133808Spjd	case G_RAID3_DISK_STATE_STALE:
438133808Spjd	case G_RAID3_DISK_STATE_SYNCHRONIZING:
439133808Spjd		if (g_raid3_clear_metadata(disk) != 0) {
440133808Spjd			gctl_error(req, "Cannot clear metadata on %s.",
441133808Spjd			    g_raid3_get_diskname(disk));
442133808Spjd			sc->sc_bump_syncid = G_RAID3_BUMP_IMMEDIATELY;
443133808Spjd		}
444133808Spjd		g_raid3_event_send(disk, G_RAID3_DISK_STATE_DISCONNECTED,
445133808Spjd		    G_RAID3_EVENT_WAIT);
446133808Spjd		break;
447133808Spjd	case G_RAID3_DISK_STATE_NODISK:
448133808Spjd		break;
449133808Spjd	default:
450133808Spjd		gctl_error(req, "Cannot replace component number %u.", *no);
451133808Spjd		return;
452133808Spjd	}
453133808Spjd}
454133808Spjd
455133808Spjdvoid
456133808Spjdg_raid3_config(struct gctl_req *req, struct g_class *mp, const char *verb)
457133808Spjd{
458133808Spjd	uint32_t *version;
459133808Spjd
460133808Spjd	g_topology_assert();
461133808Spjd
462133808Spjd	version = gctl_get_paraml(req, "version", sizeof(*version));
463133808Spjd	if (version == NULL) {
464133808Spjd		gctl_error(req, "No '%s' argument.", "version");
465133808Spjd		return;
466133808Spjd	}
467133808Spjd	if (*version != G_RAID3_VERSION) {
468133808Spjd		gctl_error(req, "Userland and kernel parts are out of sync.");
469133808Spjd		return;
470133808Spjd	}
471133808Spjd
472133808Spjd	if (strcmp(verb, "configure") == 0)
473133808Spjd		g_raid3_ctl_configure(req, mp);
474133808Spjd	else if (strcmp(verb, "insert") == 0)
475133808Spjd		g_raid3_ctl_insert(req, mp);
476133808Spjd	else if (strcmp(verb, "rebuild") == 0)
477133808Spjd		g_raid3_ctl_rebuild(req, mp);
478133808Spjd	else if (strcmp(verb, "remove") == 0)
479133808Spjd		g_raid3_ctl_remove(req, mp);
480133808Spjd	else if (strcmp(verb, "stop") == 0)
481133808Spjd		g_raid3_ctl_stop(req, mp);
482133808Spjd	else
483133808Spjd		gctl_error(req, "Unknown verb.");
484133808Spjd}
485