raid10.c (9134d02bc0af4a8747d448d1f811ec5f8eb96df6) | raid10.c (1f98a13f623e0ef666690a18c1250335fc6d7ef1) |
---|---|
1/* 2 * raid10.c : Multiple Devices driver for Linux 3 * 4 * Copyright (C) 2000-2004 Neil Brown 5 * 6 * RAID-10 support for md. 7 * 8 * Base on code in raid1.c. See raid1.c for futher copyright information. --- 782 unchanged lines hidden (view full) --- 791 conf_t *conf = mddev->private; 792 mirror_info_t *mirror; 793 r10bio_t *r10_bio; 794 struct bio *read_bio; 795 int cpu; 796 int i; 797 int chunk_sects = conf->chunk_mask + 1; 798 const int rw = bio_data_dir(bio); | 1/* 2 * raid10.c : Multiple Devices driver for Linux 3 * 4 * Copyright (C) 2000-2004 Neil Brown 5 * 6 * RAID-10 support for md. 7 * 8 * Base on code in raid1.c. See raid1.c for futher copyright information. --- 782 unchanged lines hidden (view full) --- 791 conf_t *conf = mddev->private; 792 mirror_info_t *mirror; 793 r10bio_t *r10_bio; 794 struct bio *read_bio; 795 int cpu; 796 int i; 797 int chunk_sects = conf->chunk_mask + 1; 798 const int rw = bio_data_dir(bio); |
799 const int do_sync = bio_sync(bio); | 799 const bool do_sync = bio_rw_flagged(bio, BIO_RW_SYNCIO); |
800 struct bio_list bl; 801 unsigned long flags; 802 mdk_rdev_t *blocked_rdev; 803 | 800 struct bio_list bl; 801 unsigned long flags; 802 mdk_rdev_t *blocked_rdev; 803 |
804 if (unlikely(bio_barrier(bio))) { | 804 if (unlikely(bio_rw_flagged(bio, BIO_RW_BARRIER))) { |
805 bio_endio(bio, -EOPNOTSUPP); 806 return 0; 807 } 808 809 /* If this request crosses a chunk boundary, we need to 810 * split it. This will only happen for 1 PAGE (or less) requests. 811 */ 812 if (unlikely( (bio->bi_sector & conf->chunk_mask) + (bio->bi_size >> 9) --- 792 unchanged lines hidden (view full) --- 1605 if (mirror == -1) { 1606 printk(KERN_ALERT "raid10: %s: unrecoverable I/O" 1607 " read error for block %llu\n", 1608 bdevname(bio->bi_bdev,b), 1609 (unsigned long long)r10_bio->sector); 1610 raid_end_bio_io(r10_bio); 1611 bio_put(bio); 1612 } else { | 805 bio_endio(bio, -EOPNOTSUPP); 806 return 0; 807 } 808 809 /* If this request crosses a chunk boundary, we need to 810 * split it. This will only happen for 1 PAGE (or less) requests. 811 */ 812 if (unlikely( (bio->bi_sector & conf->chunk_mask) + (bio->bi_size >> 9) --- 792 unchanged lines hidden (view full) --- 1605 if (mirror == -1) { 1606 printk(KERN_ALERT "raid10: %s: unrecoverable I/O" 1607 " read error for block %llu\n", 1608 bdevname(bio->bi_bdev,b), 1609 (unsigned long long)r10_bio->sector); 1610 raid_end_bio_io(r10_bio); 1611 bio_put(bio); 1612 } else { |
1613 const int do_sync = bio_sync(r10_bio->master_bio); | 1613 const bool do_sync = bio_rw_flagged(r10_bio->master_bio, BIO_RW_SYNCIO); |
1614 bio_put(bio); 1615 rdev = conf->mirrors[mirror].rdev; 1616 if (printk_ratelimit()) 1617 printk(KERN_ERR "raid10: %s: redirecting sector %llu to" 1618 " another mirror\n", 1619 bdevname(rdev->bdev,b), 1620 (unsigned long long)r10_bio->sector); 1621 bio = bio_clone(r10_bio->master_bio, GFP_NOIO); --- 696 unchanged lines hidden --- | 1614 bio_put(bio); 1615 rdev = conf->mirrors[mirror].rdev; 1616 if (printk_ratelimit()) 1617 printk(KERN_ERR "raid10: %s: redirecting sector %llu to" 1618 " another mirror\n", 1619 bdevname(rdev->bdev,b), 1620 (unsigned long long)r10_bio->sector); 1621 bio = bio_clone(r10_bio->master_bio, GFP_NOIO); --- 696 unchanged lines hidden --- |