g_mirror.c (137259) | g_mirror.c (137412) |
---|---|
1/*- 2 * Copyright (c) 2004 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 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/mirror/g_mirror.c 137259 2004-11-05 17:18:39Z pjd $"); | 28__FBSDID("$FreeBSD: head/sys/geom/mirror/g_mirror.c 137412 2004-11-08 20:23:53Z 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/limits.h> 35#include <sys/lock.h> 36#include <sys/mutex.h> --- 2388 unchanged lines hidden (view full) --- 2425 /* On first open, grab an extra "exclusive" bit */ 2426 if (pp->acr == 0 && pp->acw == 0 && pp->ace == 0) 2427 ace++; 2428 /* ... and let go of it on last close */ 2429 if (dcr == 0 && dcw == 0 && dce == 0) 2430 ace--; 2431 2432 sc = pp->geom->softc; | 29 30#include <sys/param.h> 31#include <sys/systm.h> 32#include <sys/kernel.h> 33#include <sys/module.h> 34#include <sys/limits.h> 35#include <sys/lock.h> 36#include <sys/mutex.h> --- 2388 unchanged lines hidden (view full) --- 2425 /* On first open, grab an extra "exclusive" bit */ 2426 if (pp->acr == 0 && pp->acw == 0 && pp->ace == 0) 2427 ace++; 2428 /* ... and let go of it on last close */ 2429 if (dcr == 0 && dcw == 0 && dce == 0) 2430 ace--; 2431 2432 sc = pp->geom->softc; |
2433 if (sc == NULL || LIST_EMPTY(&sc->sc_disks)) { | 2433 if (sc == NULL || LIST_EMPTY(&sc->sc_disks) || 2434 (sc->sc_flags & G_MIRROR_DEVICE_FLAG_DESTROY) != 0) { |
2434 if (acr <= 0 && acw <= 0 && ace <= 0) 2435 return (0); 2436 else 2437 return (ENXIO); 2438 } 2439 error = ENXIO; 2440 LIST_FOREACH(disk, &sc->sc_disks, d_next) { 2441 if (disk->d_state != G_MIRROR_DISK_STATE_ACTIVE) --- 446 unchanged lines hidden --- | 2435 if (acr <= 0 && acw <= 0 && ace <= 0) 2436 return (0); 2437 else 2438 return (ENXIO); 2439 } 2440 error = ENXIO; 2441 LIST_FOREACH(disk, &sc->sc_disks, d_next) { 2442 if (disk->d_state != G_MIRROR_DISK_STATE_ACTIVE) --- 446 unchanged lines hidden --- |