Commit 5e5bffab authored by Jens Axboe's avatar Jens Axboe

bio_endio doesn't take nr_sectors argument anymore.

parent 14d39718
...@@ -1673,12 +1673,11 @@ static void start_io( ctlr_info_t *h) ...@@ -1673,12 +1673,11 @@ static void start_io( ctlr_info_t *h)
static inline void complete_buffers(struct bio *bio, int status) static inline void complete_buffers(struct bio *bio, int status)
{ {
while (bio) { while (bio) {
int nsecs = bio_sectors(bio);
struct bio *xbh = bio->bi_next; struct bio *xbh = bio->bi_next;
bio->bi_next = NULL; bio->bi_next = NULL;
blk_finished_io(nsecs); blk_finished_io(bio_sectors(bio));
bio_endio(bio, status, nsecs); bio_endio(bio, status);
bio = xbh; bio = xbh;
} }
......
...@@ -970,13 +970,11 @@ static inline void complete_buffers(struct bio *bio, int ok) ...@@ -970,13 +970,11 @@ static inline void complete_buffers(struct bio *bio, int ok)
{ {
struct bio *xbh; struct bio *xbh;
while(bio) { while(bio) {
int nsecs = bio_sectors(bio);
xbh = bio->bi_next; xbh = bio->bi_next;
bio->bi_next = NULL; bio->bi_next = NULL;
blk_finished_io(nsecs); blk_finished_io(bio_sectors(bio));
bio_endio(bio, ok, nsecs); bio_endio(bio, ok);
bio = xbh; bio = xbh;
} }
......
...@@ -319,7 +319,7 @@ static int do_bio_filebacked(struct loop_device *lo, struct bio *bio) ...@@ -319,7 +319,7 @@ static int do_bio_filebacked(struct loop_device *lo, struct bio *bio)
return ret; return ret;
} }
static int loop_end_io_transfer(struct bio *, int); static void loop_end_io_transfer(struct bio *);
static void loop_put_buffer(struct bio *bio) static void loop_put_buffer(struct bio *bio)
{ {
/* /*
...@@ -377,21 +377,19 @@ static struct bio *loop_get_bio(struct loop_device *lo) ...@@ -377,21 +377,19 @@ static struct bio *loop_get_bio(struct loop_device *lo)
* bi_end_io context (we don't want to do decrypt of a page with irqs * bi_end_io context (we don't want to do decrypt of a page with irqs
* disabled) * disabled)
*/ */
static int loop_end_io_transfer(struct bio *bio, int nr_sectors) static void loop_end_io_transfer(struct bio *bio)
{ {
struct bio *rbh = bio->bi_private; struct bio *rbh = bio->bi_private;
struct loop_device *lo = &loop_dev[minor(rbh->bi_dev)]; struct loop_device *lo = &loop_dev[minor(rbh->bi_dev)];
int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags); int uptodate = test_bit(BIO_UPTODATE, &bio->bi_flags);
if (!uptodate || bio_rw(bio) == WRITE) { if (!uptodate || bio_rw(bio) == WRITE) {
bio_endio(rbh, uptodate, nr_sectors); bio_endio(rbh, uptodate);
if (atomic_dec_and_test(&lo->lo_pending)) if (atomic_dec_and_test(&lo->lo_pending))
up(&lo->lo_bh_mutex); up(&lo->lo_bh_mutex);
loop_put_buffer(bio); loop_put_buffer(bio);
} else } else
loop_add_bio(lo, bio); loop_add_bio(lo, bio);
return 0;
} }
static struct bio *loop_get_buffer(struct loop_device *lo, struct bio *rbh) static struct bio *loop_get_buffer(struct loop_device *lo, struct bio *rbh)
...@@ -511,13 +509,13 @@ static inline void loop_handle_bio(struct loop_device *lo, struct bio *bio) ...@@ -511,13 +509,13 @@ static inline void loop_handle_bio(struct loop_device *lo, struct bio *bio)
*/ */
if (lo->lo_flags & LO_FLAGS_DO_BMAP) { if (lo->lo_flags & LO_FLAGS_DO_BMAP) {
ret = do_bio_filebacked(lo, bio); ret = do_bio_filebacked(lo, bio);
bio_endio(bio, !ret, bio_sectors(bio)); bio_endio(bio, !ret);
} else { } else {
struct bio *rbh = bio->bi_private; struct bio *rbh = bio->bi_private;
ret = do_bio_blockbacked(lo, bio, rbh); ret = do_bio_blockbacked(lo, bio, rbh);
bio_endio(rbh, !ret, bio_sectors(rbh)); bio_endio(rbh, !ret);
loop_put_buffer(bio); loop_put_buffer(bio);
} }
} }
......
...@@ -52,7 +52,7 @@ nbd_end_request(struct request *req) ...@@ -52,7 +52,7 @@ nbd_end_request(struct request *req)
blk_finished_io(nsect); blk_finished_io(nsect);
req->bio = bio->bi_next; req->bio = bio->bi_next;
bio->bi_next = NULL; bio->bi_next = NULL;
bio_endio(bio, uptodate, nsect); bio_endio(bio, uptodate);
} }
blkdev_release_request(req); blkdev_release_request(req);
spin_unlock_irqrestore(q->queue_lock, flags); spin_unlock_irqrestore(q->queue_lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment