diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/raid5.c | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index d855f9f59b02..347caab99ca0 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -544,35 +544,7 @@ static int raid5_end_read_request(struct bio * bi, unsigned int bytes_done, | |||
544 | } | 544 | } |
545 | 545 | ||
546 | if (uptodate) { | 546 | if (uptodate) { |
547 | #if 0 | ||
548 | struct bio *bio; | ||
549 | unsigned long flags; | ||
550 | spin_lock_irqsave(&conf->device_lock, flags); | ||
551 | /* we can return a buffer if we bypassed the cache or | ||
552 | * if the top buffer is not in highmem. If there are | ||
553 | * multiple buffers, leave the extra work to | ||
554 | * handle_stripe | ||
555 | */ | ||
556 | buffer = sh->bh_read[i]; | ||
557 | if (buffer && | ||
558 | (!PageHighMem(buffer->b_page) | ||
559 | || buffer->b_page == bh->b_page ) | ||
560 | ) { | ||
561 | sh->bh_read[i] = buffer->b_reqnext; | ||
562 | buffer->b_reqnext = NULL; | ||
563 | } else | ||
564 | buffer = NULL; | ||
565 | spin_unlock_irqrestore(&conf->device_lock, flags); | ||
566 | if (sh->bh_page[i]==bh->b_page) | ||
567 | set_buffer_uptodate(bh); | ||
568 | if (buffer) { | ||
569 | if (buffer->b_page != bh->b_page) | ||
570 | memcpy(buffer->b_data, bh->b_data, bh->b_size); | ||
571 | buffer->b_end_io(buffer, 1); | ||
572 | } | ||
573 | #else | ||
574 | set_bit(R5_UPTODATE, &sh->dev[i].flags); | 547 | set_bit(R5_UPTODATE, &sh->dev[i].flags); |
575 | #endif | ||
576 | if (test_bit(R5_ReadError, &sh->dev[i].flags)) { | 548 | if (test_bit(R5_ReadError, &sh->dev[i].flags)) { |
577 | rdev = conf->disks[i].rdev; | 549 | rdev = conf->disks[i].rdev; |
578 | printk(KERN_INFO "raid5:%s: read error corrected (%lu sectors at %llu on %s)\n", | 550 | printk(KERN_INFO "raid5:%s: read error corrected (%lu sectors at %llu on %s)\n", |
@@ -618,14 +590,6 @@ static int raid5_end_read_request(struct bio * bi, unsigned int bytes_done, | |||
618 | } | 590 | } |
619 | } | 591 | } |
620 | rdev_dec_pending(conf->disks[i].rdev, conf->mddev); | 592 | rdev_dec_pending(conf->disks[i].rdev, conf->mddev); |
621 | #if 0 | ||
622 | /* must restore b_page before unlocking buffer... */ | ||
623 | if (sh->bh_page[i] != bh->b_page) { | ||
624 | bh->b_page = sh->bh_page[i]; | ||
625 | bh->b_data = page_address(bh->b_page); | ||
626 | clear_buffer_uptodate(bh); | ||
627 | } | ||
628 | #endif | ||
629 | clear_bit(R5_LOCKED, &sh->dev[i].flags); | 593 | clear_bit(R5_LOCKED, &sh->dev[i].flags); |
630 | set_bit(STRIPE_HANDLE, &sh->state); | 594 | set_bit(STRIPE_HANDLE, &sh->state); |
631 | release_stripe(sh); | 595 | release_stripe(sh); |
@@ -1619,15 +1583,6 @@ static void handle_stripe5(struct stripe_head *sh) | |||
1619 | } else if (test_bit(R5_Insync, &dev->flags)) { | 1583 | } else if (test_bit(R5_Insync, &dev->flags)) { |
1620 | set_bit(R5_LOCKED, &dev->flags); | 1584 | set_bit(R5_LOCKED, &dev->flags); |
1621 | set_bit(R5_Wantread, &dev->flags); | 1585 | set_bit(R5_Wantread, &dev->flags); |
1622 | #if 0 | ||
1623 | /* if I am just reading this block and we don't have | ||
1624 | a failed drive, or any pending writes then sidestep the cache */ | ||
1625 | if (sh->bh_read[i] && !sh->bh_read[i]->b_reqnext && | ||
1626 | ! syncing && !failed && !to_write) { | ||
1627 | sh->bh_cache[i]->b_page = sh->bh_read[i]->b_page; | ||
1628 | sh->bh_cache[i]->b_data = sh->bh_read[i]->b_data; | ||
1629 | } | ||
1630 | #endif | ||
1631 | locked++; | 1586 | locked++; |
1632 | PRINTK("Reading block %d (sync=%d)\n", | 1587 | PRINTK("Reading block %d (sync=%d)\n", |
1633 | i, syncing); | 1588 | i, syncing); |
@@ -1645,9 +1600,6 @@ static void handle_stripe5(struct stripe_head *sh) | |||
1645 | dev = &sh->dev[i]; | 1600 | dev = &sh->dev[i]; |
1646 | if ((dev->towrite || i == sh->pd_idx) && | 1601 | if ((dev->towrite || i == sh->pd_idx) && |
1647 | (!test_bit(R5_LOCKED, &dev->flags) | 1602 | (!test_bit(R5_LOCKED, &dev->flags) |
1648 | #if 0 | ||
1649 | || sh->bh_page[i]!=bh->b_page | ||
1650 | #endif | ||
1651 | ) && | 1603 | ) && |
1652 | !test_bit(R5_UPTODATE, &dev->flags)) { | 1604 | !test_bit(R5_UPTODATE, &dev->flags)) { |
1653 | if (test_bit(R5_Insync, &dev->flags) | 1605 | if (test_bit(R5_Insync, &dev->flags) |
@@ -1659,9 +1611,6 @@ static void handle_stripe5(struct stripe_head *sh) | |||
1659 | /* Would I have to read this buffer for reconstruct_write */ | 1611 | /* Would I have to read this buffer for reconstruct_write */ |
1660 | if (!test_bit(R5_OVERWRITE, &dev->flags) && i != sh->pd_idx && | 1612 | if (!test_bit(R5_OVERWRITE, &dev->flags) && i != sh->pd_idx && |
1661 | (!test_bit(R5_LOCKED, &dev->flags) | 1613 | (!test_bit(R5_LOCKED, &dev->flags) |
1662 | #if 0 | ||
1663 | || sh->bh_page[i] != bh->b_page | ||
1664 | #endif | ||
1665 | ) && | 1614 | ) && |
1666 | !test_bit(R5_UPTODATE, &dev->flags)) { | 1615 | !test_bit(R5_UPTODATE, &dev->flags)) { |
1667 | if (test_bit(R5_Insync, &dev->flags)) rcw++; | 1616 | if (test_bit(R5_Insync, &dev->flags)) rcw++; |
@@ -2197,15 +2146,6 @@ static void handle_stripe6(struct stripe_head *sh, struct page *tmp_page) | |||
2197 | } else if (test_bit(R5_Insync, &dev->flags)) { | 2146 | } else if (test_bit(R5_Insync, &dev->flags)) { |
2198 | set_bit(R5_LOCKED, &dev->flags); | 2147 | set_bit(R5_LOCKED, &dev->flags); |
2199 | set_bit(R5_Wantread, &dev->flags); | 2148 | set_bit(R5_Wantread, &dev->flags); |
2200 | #if 0 | ||
2201 | /* if I am just reading this block and we don't have | ||
2202 | a failed drive, or any pending writes then sidestep the cache */ | ||
2203 | if (sh->bh_read[i] && !sh->bh_read[i]->b_reqnext && | ||
2204 | ! syncing && !failed && !to_write) { | ||
2205 | sh->bh_cache[i]->b_page = sh->bh_read[i]->b_page; | ||
2206 | sh->bh_cache[i]->b_data = sh->bh_read[i]->b_data; | ||
2207 | } | ||
2208 | #endif | ||
2209 | locked++; | 2149 | locked++; |
2210 | PRINTK("Reading block %d (sync=%d)\n", | 2150 | PRINTK("Reading block %d (sync=%d)\n", |
2211 | i, syncing); | 2151 | i, syncing); |
@@ -2224,9 +2164,6 @@ static void handle_stripe6(struct stripe_head *sh, struct page *tmp_page) | |||
2224 | if (!test_bit(R5_OVERWRITE, &dev->flags) | 2164 | if (!test_bit(R5_OVERWRITE, &dev->flags) |
2225 | && i != pd_idx && i != qd_idx | 2165 | && i != pd_idx && i != qd_idx |
2226 | && (!test_bit(R5_LOCKED, &dev->flags) | 2166 | && (!test_bit(R5_LOCKED, &dev->flags) |
2227 | #if 0 | ||
2228 | || sh->bh_page[i] != bh->b_page | ||
2229 | #endif | ||
2230 | ) && | 2167 | ) && |
2231 | !test_bit(R5_UPTODATE, &dev->flags)) { | 2168 | !test_bit(R5_UPTODATE, &dev->flags)) { |
2232 | if (test_bit(R5_Insync, &dev->flags)) rcw++; | 2169 | if (test_bit(R5_Insync, &dev->flags)) rcw++; |