Deleted Added
full compact
tr_raid1.c (220209) tr_raid1.c (220210)
1/*-
2 * Copyright (c) 2010 Alexander Motin <mav@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) 2010 Alexander Motin <mav@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/raid/tr_raid1.c 220209 2011-03-31 16:14:35Z mav $");
28__FBSDID("$FreeBSD: head/sys/geom/raid/tr_raid1.c 220210 2011-03-31 16:19:53Z mav $");
29
30#include <sys/param.h>
31#include <sys/bio.h>
32#include <sys/endian.h>
33#include <sys/kernel.h>
34#include <sys/kobj.h>
35#include <sys/limits.h>
36#include <sys/lock.h>

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

544 }
545
546 g_raid_subdisk_iostart(sd, cbp);
547}
548
549static void
550g_raid_tr_iostart_raid1_write(struct g_raid_tr_object *tr, struct bio *bp)
551{
29
30#include <sys/param.h>
31#include <sys/bio.h>
32#include <sys/endian.h>
33#include <sys/kernel.h>
34#include <sys/kobj.h>
35#include <sys/limits.h>
36#include <sys/lock.h>

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

544 }
545
546 g_raid_subdisk_iostart(sd, cbp);
547}
548
549static void
550g_raid_tr_iostart_raid1_write(struct g_raid_tr_object *tr, struct bio *bp)
551{
552 struct g_raid_softc *sc;
553 struct g_raid_volume *vol;
554 struct g_raid_subdisk *sd;
555 struct bio_queue_head queue;
556 struct bio *cbp;
557 int i;
558
559 vol = tr->tro_volume;
552 struct g_raid_volume *vol;
553 struct g_raid_subdisk *sd;
554 struct bio_queue_head queue;
555 struct bio *cbp;
556 int i;
557
558 vol = tr->tro_volume;
560 sc = vol->v_softc;
561
562 /*
563 * Allocate all bios before sending any request, so we can return
564 * ENOMEM in nice and clean way.
565 */
566 bioq_init(&queue);
567 for (i = 0; i < vol->v_disks_count; i++) {
568 sd = &vol->v_subdisks[i];

--- 423 unchanged lines hidden ---
559
560 /*
561 * Allocate all bios before sending any request, so we can return
562 * ENOMEM in nice and clean way.
563 */
564 bioq_init(&queue);
565 for (i = 0; i < vol->v_disks_count; i++) {
566 sd = &vol->v_subdisks[i];

--- 423 unchanged lines hidden ---