raid1.c (6b9656205469269c050963c71fca1998b247a560) raid1.c (2c7d46ec192e4f2b350f67a0e185b9bce646cd6b)
1/*
2 * raid1.c : Multiple Devices driver for Linux
3 *
4 * Copyright (C) 1999, 2000, 2001 Ingo Molnar, Red Hat
5 *
6 * Copyright (C) 1996, 1997, 1998 Ingo Molnar, Miguel de Icaza, Gadi Oxman
7 *
8 * RAID-1 management functions.

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

782 r1bio_t *r1_bio;
783 struct bio *read_bio;
784 int i, targets = 0, disks;
785 struct bitmap *bitmap;
786 unsigned long flags;
787 struct bio_list bl;
788 struct page **behind_pages = NULL;
789 const int rw = bio_data_dir(bio);
1/*
2 * raid1.c : Multiple Devices driver for Linux
3 *
4 * Copyright (C) 1999, 2000, 2001 Ingo Molnar, Red Hat
5 *
6 * Copyright (C) 1996, 1997, 1998 Ingo Molnar, Miguel de Icaza, Gadi Oxman
7 *
8 * RAID-1 management functions.

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

782 r1bio_t *r1_bio;
783 struct bio *read_bio;
784 int i, targets = 0, disks;
785 struct bitmap *bitmap;
786 unsigned long flags;
787 struct bio_list bl;
788 struct page **behind_pages = NULL;
789 const int rw = bio_data_dir(bio);
790 const bool do_sync = (bio->bi_rw & REQ_SYNC);
791 bool do_barriers;
790 const unsigned long do_sync = (bio->bi_rw & REQ_SYNC);
791 unsigned long do_barriers;
792 mdk_rdev_t *blocked_rdev;
793
794 /*
795 * Register the new request and wait if the reconstruction
796 * thread has put up a bar for new requests.
797 * Continue immediately if no resync is active currently.
798 * We test barriers_work *after* md_write_start as md_write_start
799 * may cause the first superblock write, and that will check out

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

1638 /* some requests in the r1bio were REQ_HARDBARRIER
1639 * requests which failed with -EOPNOTSUPP. Hohumm..
1640 * Better resubmit without the barrier.
1641 * We know which devices to resubmit for, because
1642 * all others have had their bios[] entry cleared.
1643 * We already have a nr_pending reference on these rdevs.
1644 */
1645 int i;
792 mdk_rdev_t *blocked_rdev;
793
794 /*
795 * Register the new request and wait if the reconstruction
796 * thread has put up a bar for new requests.
797 * Continue immediately if no resync is active currently.
798 * We test barriers_work *after* md_write_start as md_write_start
799 * may cause the first superblock write, and that will check out

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

1638 /* some requests in the r1bio were REQ_HARDBARRIER
1639 * requests which failed with -EOPNOTSUPP. Hohumm..
1640 * Better resubmit without the barrier.
1641 * We know which devices to resubmit for, because
1642 * all others have had their bios[] entry cleared.
1643 * We already have a nr_pending reference on these rdevs.
1644 */
1645 int i;
1646 const bool do_sync = (r1_bio->master_bio->bi_rw & REQ_SYNC);
1646 const unsigned long do_sync = (r1_bio->master_bio->bi_rw & REQ_SYNC);
1647 clear_bit(R1BIO_BarrierRetry, &r1_bio->state);
1648 clear_bit(R1BIO_Barrier, &r1_bio->state);
1649 for (i=0; i < conf->raid_disks; i++)
1650 if (r1_bio->bios[i])
1651 atomic_inc(&r1_bio->remaining);
1652 for (i=0; i < conf->raid_disks; i++)
1653 if (r1_bio->bios[i]) {
1654 struct bio_vec *bvec;

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

1694 if ((disk=read_balance(conf, r1_bio)) == -1) {
1695 printk(KERN_ALERT "md/raid1:%s: %s: unrecoverable I/O"
1696 " read error for block %llu\n",
1697 mdname(mddev),
1698 bdevname(bio->bi_bdev,b),
1699 (unsigned long long)r1_bio->sector);
1700 raid_end_bio_io(r1_bio);
1701 } else {
1647 clear_bit(R1BIO_BarrierRetry, &r1_bio->state);
1648 clear_bit(R1BIO_Barrier, &r1_bio->state);
1649 for (i=0; i < conf->raid_disks; i++)
1650 if (r1_bio->bios[i])
1651 atomic_inc(&r1_bio->remaining);
1652 for (i=0; i < conf->raid_disks; i++)
1653 if (r1_bio->bios[i]) {
1654 struct bio_vec *bvec;

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

1694 if ((disk=read_balance(conf, r1_bio)) == -1) {
1695 printk(KERN_ALERT "md/raid1:%s: %s: unrecoverable I/O"
1696 " read error for block %llu\n",
1697 mdname(mddev),
1698 bdevname(bio->bi_bdev,b),
1699 (unsigned long long)r1_bio->sector);
1700 raid_end_bio_io(r1_bio);
1701 } else {
1702 const bool do_sync = r1_bio->master_bio->bi_rw & REQ_SYNC;
1702 const unsigned long do_sync = r1_bio->master_bio->bi_rw & REQ_SYNC;
1703 r1_bio->bios[r1_bio->read_disk] =
1704 mddev->ro ? IO_BLOCKED : NULL;
1705 r1_bio->read_disk = disk;
1706 bio_put(bio);
1707 bio = bio_clone(r1_bio->master_bio, GFP_NOIO);
1708 r1_bio->bios[r1_bio->read_disk] = bio;
1709 rdev = conf->mirrors[disk].rdev;
1710 if (printk_ratelimit())

--- 684 unchanged lines hidden ---
1703 r1_bio->bios[r1_bio->read_disk] =
1704 mddev->ro ? IO_BLOCKED : NULL;
1705 r1_bio->read_disk = disk;
1706 bio_put(bio);
1707 bio = bio_clone(r1_bio->master_bio, GFP_NOIO);
1708 r1_bio->bios[r1_bio->read_disk] = bio;
1709 rdev = conf->mirrors[disk].rdev;
1710 if (printk_ratelimit())

--- 684 unchanged lines hidden ---