diff options
| -rw-r--r-- | drivers/block/ll_rw_blk.c | 12 | ||||
| -rw-r--r-- | drivers/md/raid1.c | 28 | ||||
| -rw-r--r-- | fs/bio.c | 9 | ||||
| -rw-r--r-- | include/linux/bio.h | 6 | ||||
| -rw-r--r-- | mm/highmem.c | 29 |
5 files changed, 34 insertions, 50 deletions
diff --git a/drivers/block/ll_rw_blk.c b/drivers/block/ll_rw_blk.c index e59352d852bd..c0add6a20e89 100644 --- a/drivers/block/ll_rw_blk.c +++ b/drivers/block/ll_rw_blk.c @@ -1227,7 +1227,7 @@ out: return 0; end_io: - bio->bi_end_io(bio, nr_sectors); + bio->bi_end_io(bio); return 0; } @@ -1329,7 +1329,7 @@ void generic_make_request(struct bio *bio) "generic_make_request: Trying to access nonexistent block-device %s (%Lu)\n", kdevname(bio->bi_dev), (long long) bio->bi_sector); end_io: - bio->bi_end_io(bio, nr_sectors); + bio->bi_end_io(bio); break; } @@ -1350,15 +1350,12 @@ end_io: /* * our default bio end_io callback handler for a buffer_head mapping. */ -static int end_bio_bh_io_sync(struct bio *bio, int nr_sectors) +static void end_bio_bh_io_sync(struct bio *bio) { struct buffer_head *bh = bio->bi_private; - BIO_BUG_ON(nr_sectors != (bh->b_size >> 9)); - bh->b_end_io(bh, test_bit(BIO_UPTODATE, &bio->bi_flags)); bio_put(bio); - return 0; } /** @@ -1641,8 +1638,7 @@ int end_that_request_first(struct request *req, int uptodate, int nr_sectors) if (!bio->bi_size) { req->bio = bio->bi_next; - if (unlikely(bio_endio(bio, uptodate, total_nsect))) - BUG(); + bio_endio(bio, uptodate); total_nsect = 0; } diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index 3481c238f160..9e7ad9623bc9 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -225,14 +225,12 @@ static void reschedule_retry(r1bio_t *r1_bio) * operation and are ready to return a success/failure code to the buffer * cache layer. */ -static int raid_end_bio_io(r1bio_t *r1_bio, int uptodate, int nr_sectors) +static void raid_end_bio_io(r1bio_t *r1_bio, int uptodate) { struct bio *bio = r1_bio->master_bio; - bio_endio(bio, uptodate, nr_sectors); + bio_endio(bio, uptodate); free_r1bio(r1_bio); - - return 0; } /* @@ -247,7 +245,7 @@ static void inline update_head_pos(int disk, r1bio_t *r1_bio) atomic_dec(&conf->mirrors[disk].nr_pending); } -static int end_request(struct bio *bio, int nr_sectors) +static void end_request(struct bio *bio) { int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); r1bio_t * r1_bio = (r1bio_t *)(bio->bi_private); @@ -278,8 +276,8 @@ static int end_request(struct bio *bio, int nr_sectors) * we have only one bio on the read side */ if (uptodate) { - raid_end_bio_io(r1_bio, uptodate, nr_sectors); - return 0; + raid_end_bio_io(r1_bio, uptodate); + return; } /* * oops, read error: @@ -287,7 +285,7 @@ static int end_request(struct bio *bio, int nr_sectors) printk(KERN_ERR "raid1: %s: rescheduling sector %lu\n", partition_name(bio->bi_dev), r1_bio->sector); reschedule_retry(r1_bio); - return 0; + return; } if (r1_bio->read_bio) @@ -307,8 +305,7 @@ static int end_request(struct bio *bio, int nr_sectors) * already. */ if (atomic_dec_and_test(&r1_bio->remaining)) - raid_end_bio_io(r1_bio, uptodate, nr_sectors); - return 0; + raid_end_bio_io(r1_bio, uptodate); } /* @@ -518,7 +515,7 @@ static int make_request(mddev_t *mddev, int rw, struct bio * bio) * If all mirrors are non-operational * then return an IO error: */ - raid_end_bio_io(r1_bio, 0, 0); + raid_end_bio_io(r1_bio, 0); return 0; } atomic_set(&r1_bio->remaining, sum_bios); @@ -930,7 +927,7 @@ abort: #define REDIRECT_SECTOR KERN_ERR \ "raid1: %s: redirecting sector %lu to another mirror\n" -static int end_sync_read(struct bio *bio, int nr_sectors) +static void end_sync_read(struct bio *bio) { int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); r1bio_t * r1_bio = (r1bio_t *)(bio->bi_private); @@ -948,11 +945,9 @@ static int end_sync_read(struct bio *bio, int nr_sectors) else set_bit(R1BIO_Uptodate, &r1_bio->state); reschedule_retry(r1_bio); - - return 0; } -static int end_sync_write(struct bio *bio, int nr_sectors) +static void end_sync_write(struct bio *bio) { int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); r1bio_t * r1_bio = (r1bio_t *)(bio->bi_private); @@ -974,7 +969,6 @@ static int end_sync_write(struct bio *bio, int nr_sectors) resume_device(conf); put_buf(r1_bio); } - return 0; } static void sync_request_write(mddev_t *mddev, r1bio_t *r1_bio) @@ -1100,7 +1094,7 @@ static void raid1d(void *data) map(mddev, &bio->bi_dev); if (kdev_same(bio->bi_dev, dev)) { printk(IO_ERROR, partition_name(bio->bi_dev), r1_bio->sector); - raid_end_bio_io(r1_bio, 0, 0); + raid_end_bio_io(r1_bio, 0); break; } printk(REDIRECT_SECTOR, @@ -316,13 +316,12 @@ oom: return NULL; } -static int bio_end_io_kio(struct bio *bio, int nr_sectors) +static void bio_end_io_kio(struct bio *bio) { struct kiobuf *kio = (struct kiobuf *) bio->bi_private; end_kio_request(kio, test_bit(BIO_UPTODATE, &bio->bi_flags)); bio_put(bio); - return 0; } /** @@ -441,7 +440,7 @@ out: end_kio_request(kio, !err); } -int bio_endio(struct bio *bio, int uptodate, int nr_sectors) +void bio_endio(struct bio *bio, int uptodate) { if (uptodate) set_bit(BIO_UPTODATE, &bio->bi_flags); @@ -449,9 +448,7 @@ int bio_endio(struct bio *bio, int uptodate, int nr_sectors) clear_bit(BIO_UPTODATE, &bio->bi_flags); if (bio->bi_end_io) - return bio->bi_end_io(bio, nr_sectors); - - return 0; + bio->bi_end_io(bio); } static void __init biovec_init_pool(void) diff --git a/include/linux/bio.h b/include/linux/bio.h index a34f8d7dc4aa..12b38c8436a2 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -50,7 +50,7 @@ struct bio_vec { * weee, c forward decl... */ struct bio; -typedef int (bio_end_io_t) (struct bio *, int); +typedef void (bio_end_io_t) (struct bio *); typedef void (bio_destructor_t) (struct bio *); /* @@ -159,7 +159,7 @@ struct bio { #define BIO_SEG_BOUNDARY(q, b1, b2) \ BIOVEC_SEG_BOUNDARY((q), __BVEC_END((b1)), __BVEC_START((b2))) -#define bio_io_error(bio) bio_endio((bio), 0, bio_sectors((bio))) +#define bio_io_error(bio) bio_endio((bio), 0) /* * drivers should not use the __ version unless they _really_ want to @@ -192,7 +192,7 @@ struct bio { extern struct bio *bio_alloc(int, int); extern void bio_put(struct bio *); -extern int bio_endio(struct bio *, int, int); +extern void bio_endio(struct bio *, int); struct request_queue; extern inline int bio_phys_segments(struct request_queue *, struct bio *); extern inline int bio_hw_segments(struct request_queue *, struct bio *); diff --git a/mm/highmem.c b/mm/highmem.c index 3abe1c093efb..acb7ced9b03b 100644 --- a/mm/highmem.c +++ b/mm/highmem.c @@ -288,11 +288,11 @@ static inline void copy_to_high_bio_irq(struct bio *to, struct bio *from) } } -static inline int bounce_end_io (struct bio *bio, int nr_sectors, mempool_t *pool) +static inline void bounce_end_io(struct bio *bio, mempool_t *pool) { struct bio *bio_orig = bio->bi_private; struct bio_vec *bvec, *org_vec; - int ret, i; + int i; if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) goto out_eio; @@ -311,41 +311,38 @@ static inline int bounce_end_io (struct bio *bio, int nr_sectors, mempool_t *poo } out_eio: - ret = bio_orig->bi_end_io(bio_orig, nr_sectors); - + bio_orig->bi_end_io(bio_orig); bio_put(bio); - return ret; } -static int bounce_end_io_write(struct bio *bio, int nr_sectors) +static void bounce_end_io_write(struct bio *bio) { - return bounce_end_io(bio, nr_sectors, page_pool); + bounce_end_io(bio, page_pool); } -static int bounce_end_io_write_isa(struct bio *bio, int nr_sectors) +static void bounce_end_io_write_isa(struct bio *bio) { - return bounce_end_io(bio, nr_sectors, isa_page_pool); + bounce_end_io(bio, isa_page_pool); } -static inline int __bounce_end_io_read(struct bio *bio, int nr_sectors, - mempool_t *pool) +static inline void __bounce_end_io_read(struct bio *bio, mempool_t *pool) { struct bio *bio_orig = bio->bi_private; if (test_bit(BIO_UPTODATE, &bio->bi_flags)) copy_to_high_bio_irq(bio_orig, bio); - return bounce_end_io(bio, nr_sectors, pool); + bounce_end_io(bio, pool); } -static int bounce_end_io_read(struct bio *bio, int nr_sectors) +static void bounce_end_io_read(struct bio *bio) { - return __bounce_end_io_read(bio, nr_sectors, page_pool); + __bounce_end_io_read(bio, page_pool); } -static int bounce_end_io_read_isa(struct bio *bio, int nr_sectors) +static void bounce_end_io_read_isa(struct bio *bio) { - return __bounce_end_io_read(bio, nr_sectors, isa_page_pool); + return __bounce_end_io_read(bio, isa_page_pool); } void create_bounce(unsigned long pfn, int gfp, struct bio **bio_orig) |
