diff options
author | Neil Brown <neilb@notabene.brown> | 2008-06-27 18:31:20 -0400 |
---|---|---|
committer | Neil Brown <neilb@notabene.brown> | 2008-06-27 18:31:20 -0400 |
commit | 0e13fe23a00ad88c737d91d94a050707c6139ce4 (patch) | |
tree | 7b52d698f200751cd332948a6ad982d8e839ee2d /drivers | |
parent | 13864515f7bf6cabd60e63c62e09d311386ae1f1 (diff) |
use bio_endio instead of a call to bi_end_io
Turn calls to bi->bi_end_io() into bio_endio(). Apparently bio_endio does
exactly the same error processing as is hardcoded at these places.
bio_endio() avoids recursion (or will soon), so it should be used.
Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/raid5.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 54c8ee28fcc4..214b44122822 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -115,9 +115,7 @@ static void return_io(struct bio *return_bi) | |||
115 | return_bi = bi->bi_next; | 115 | return_bi = bi->bi_next; |
116 | bi->bi_next = NULL; | 116 | bi->bi_next = NULL; |
117 | bi->bi_size = 0; | 117 | bi->bi_size = 0; |
118 | bi->bi_end_io(bi, | 118 | bio_endio(bi, 0); |
119 | test_bit(BIO_UPTODATE, &bi->bi_flags) | ||
120 | ? 0 : -EIO); | ||
121 | bi = return_bi; | 119 | bi = return_bi; |
122 | } | 120 | } |
123 | } | 121 | } |
@@ -3700,9 +3698,7 @@ static int make_request(struct request_queue *q, struct bio * bi) | |||
3700 | if ( rw == WRITE ) | 3698 | if ( rw == WRITE ) |
3701 | md_write_end(mddev); | 3699 | md_write_end(mddev); |
3702 | 3700 | ||
3703 | bi->bi_end_io(bi, | 3701 | bio_endio(bi, 0); |
3704 | test_bit(BIO_UPTODATE, &bi->bi_flags) | ||
3705 | ? 0 : -EIO); | ||
3706 | } | 3702 | } |
3707 | return 0; | 3703 | return 0; |
3708 | } | 3704 | } |
@@ -4005,12 +4001,8 @@ static int retry_aligned_read(raid5_conf_t *conf, struct bio *raid_bio) | |||
4005 | spin_lock_irq(&conf->device_lock); | 4001 | spin_lock_irq(&conf->device_lock); |
4006 | remaining = --raid_bio->bi_phys_segments; | 4002 | remaining = --raid_bio->bi_phys_segments; |
4007 | spin_unlock_irq(&conf->device_lock); | 4003 | spin_unlock_irq(&conf->device_lock); |
4008 | if (remaining == 0) { | 4004 | if (remaining == 0) |
4009 | 4005 | bio_endio(raid_bio, 0); | |
4010 | raid_bio->bi_end_io(raid_bio, | ||
4011 | test_bit(BIO_UPTODATE, &raid_bio->bi_flags) | ||
4012 | ? 0 : -EIO); | ||
4013 | } | ||
4014 | if (atomic_dec_and_test(&conf->active_aligned_reads)) | 4006 | if (atomic_dec_and_test(&conf->active_aligned_reads)) |
4015 | wake_up(&conf->wait_for_stripe); | 4007 | wake_up(&conf->wait_for_stripe); |
4016 | return handled; | 4008 | return handled; |