Deleted Added
full compact
g_raid3_ctl.c (160155) g_raid3_ctl.c (160330)
1/*-
2 * Copyright (c) 2004-2006 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2004-2006 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/geom/raid3/g_raid3_ctl.c 160155 2006-07-07 14:32:27Z pjd $");
28__FBSDID("$FreeBSD: head/sys/geom/raid3/g_raid3_ctl.c 160330 2006-07-13 20:37:59Z pjd $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/kernel.h>
33#include <sys/module.h>
34#include <sys/lock.h>
35#include <sys/mutex.h>
36#include <sys/bio.h>

--- 34 unchanged lines hidden (view full) ---

71
72static struct g_raid3_disk *
73g_raid3_find_disk(struct g_raid3_softc *sc, const char *name)
74{
75 struct g_raid3_disk *disk;
76 u_int n;
77
78 sx_assert(&sc->sc_lock, SX_XLOCKED);
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/kernel.h>
33#include <sys/module.h>
34#include <sys/lock.h>
35#include <sys/mutex.h>
36#include <sys/bio.h>

--- 34 unchanged lines hidden (view full) ---

71
72static struct g_raid3_disk *
73g_raid3_find_disk(struct g_raid3_softc *sc, const char *name)
74{
75 struct g_raid3_disk *disk;
76 u_int n;
77
78 sx_assert(&sc->sc_lock, SX_XLOCKED);
79 if (strncmp(name, "/dev/", 5) == 0)
80 name += 5;
79 for (n = 0; n < sc->sc_ndisks; n++) {
80 disk = &sc->sc_disks[n];
81 if (disk->d_state == G_RAID3_DISK_STATE_NODISK)
82 continue;
83 if (disk->d_consumer == NULL)
84 continue;
85 if (disk->d_consumer->provider == NULL)
86 continue;

--- 309 unchanged lines hidden (view full) ---

396 gctl_error(req, "No 'arg%u' argument.", 1);
397 return;
398 }
399 no = gctl_get_paraml(req, "number", sizeof(*no));
400 if (no == NULL) {
401 gctl_error(req, "No '%s' argument.", "no");
402 return;
403 }
81 for (n = 0; n < sc->sc_ndisks; n++) {
82 disk = &sc->sc_disks[n];
83 if (disk->d_state == G_RAID3_DISK_STATE_NODISK)
84 continue;
85 if (disk->d_consumer == NULL)
86 continue;
87 if (disk->d_consumer->provider == NULL)
88 continue;

--- 309 unchanged lines hidden (view full) ---

398 gctl_error(req, "No 'arg%u' argument.", 1);
399 return;
400 }
401 no = gctl_get_paraml(req, "number", sizeof(*no));
402 if (no == NULL) {
403 gctl_error(req, "No '%s' argument.", "no");
404 return;
405 }
406 if (strncmp(name, "/dev/", 5) == 0)
407 name += 5;
404 g_topology_lock();
405 pp = g_provider_by_name(name);
406 if (pp == NULL) {
407 g_topology_unlock();
408 gctl_error(req, "Invalid provider.");
409 return;
410 }
411 gp = g_new_geomf(mp, "raid3:insert");

--- 186 unchanged lines hidden ---
408 g_topology_lock();
409 pp = g_provider_by_name(name);
410 if (pp == NULL) {
411 g_topology_unlock();
412 gctl_error(req, "Invalid provider.");
413 return;
414 }
415 gp = g_new_geomf(mp, "raid3:insert");

--- 186 unchanged lines hidden ---