Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6712ecf8 authored by NeilBrown's avatar NeilBrown Committed by Jens Axboe
Browse files

Drop 'size' argument from bio_endio and bi_end_io



As bi_end_io is only called once when the reqeust is complete,
the 'size' argument is now redundant.  Remove it.

Now there is no need for bio_endio to subtract the size completed
from bi_size.  So don't do that either.

While we are at it, change bi_end_io to return void.

Signed-off-by: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
parent 5bb23a68
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -547,7 +547,7 @@ static void req_bio_endio(struct request *rq, struct bio *bio,
		bio->bi_size -= nbytes;
		bio->bi_sector += (nbytes >> 9);
		if (bio->bi_size == 0)
			bio_endio(bio, bio->bi_size, error);
			bio_endio(bio, error);
	} else {

		/*
@@ -2401,7 +2401,7 @@ static int __blk_rq_map_user(struct request_queue *q, struct request *rq,
		return bio->bi_size;

	/* if it was boucned we must call the end io function */
	bio_endio(bio, bio->bi_size, 0);
	bio_endio(bio, 0);
	__blk_rq_unmap_user(orig_bio);
	bio_put(bio);
	return ret;
@@ -2510,7 +2510,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
		return PTR_ERR(bio);

	if (bio->bi_size != len) {
		bio_endio(bio, bio->bi_size, 0);
		bio_endio(bio, 0);
		bio_unmap_user(bio);
		return -EINVAL;
	}
@@ -3040,7 +3040,7 @@ static int __make_request(struct request_queue *q, struct bio *bio)
	return 0;

end_io:
	bio_endio(bio, nr_sectors << 9, err);
	bio_endio(bio, err);
	return 0;
}

@@ -3187,7 +3187,7 @@ static inline void __generic_make_request(struct bio *bio)
				bdevname(bio->bi_bdev, b),
				(long long) bio->bi_sector);
end_io:
			bio_endio(bio, bio->bi_size, -EIO);
			bio_endio(bio, -EIO);
			break;
		}

+2 −2
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ aoeblk_make_request(struct request_queue *q, struct bio *bio)
	buf = mempool_alloc(d->bufpool, GFP_NOIO);
	if (buf == NULL) {
		printk(KERN_INFO "aoe: buf allocation failure\n");
		bio_endio(bio, bio->bi_size, -ENOMEM);
		bio_endio(bio, -ENOMEM);
		return 0;
	}
	memset(buf, 0, sizeof(*buf));
@@ -159,7 +159,7 @@ aoeblk_make_request(struct request_queue *q, struct bio *bio)
			d->aoemajor, d->aoeminor);
		spin_unlock_irqrestore(&d->lock, flags);
		mempool_free(buf, d->bufpool);
		bio_endio(bio, bio->bi_size, -ENXIO);
		bio_endio(bio, -ENXIO);
		return 0;
	}

+1 −1
Original line number Diff line number Diff line
@@ -652,7 +652,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
			disk_stat_add(disk, sectors[rw], n_sect);
			disk_stat_add(disk, io_ticks, duration);
			n = (buf->flags & BUFFL_FAIL) ? -EIO : 0;
			bio_endio(buf->bio, buf->bio->bi_size, n);
			bio_endio(buf->bio, n);
			mempool_free(buf, d->bufpool);
		}
	}
+2 −2
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ aoedev_downdev(struct aoedev *d)
		bio = buf->bio;
		if (--buf->nframesout == 0) {
			mempool_free(buf, d->bufpool);
			bio_endio(bio, bio->bi_size, -EIO);
			bio_endio(bio, -EIO);
		}
		skb_shinfo(f->skb)->nr_frags = f->skb->data_len = 0;
	}
@@ -130,7 +130,7 @@ aoedev_downdev(struct aoedev *d)
		list_del(d->bufq.next);
		bio = buf->bio;
		mempool_free(buf, d->bufpool);
		bio_endio(bio, bio->bi_size, -EIO);
		bio_endio(bio, -EIO);
	}

	if (d->gd)
+1 −1
Original line number Diff line number Diff line
@@ -1194,7 +1194,7 @@ static inline void complete_buffers(struct bio *bio, int status)
		int nr_sectors = bio_sectors(bio);

		bio->bi_next = NULL;
		bio_endio(bio, nr_sectors << 9, status ? 0 : -EIO);
		bio_endio(bio, status ? 0 : -EIO);
		bio = xbh;
	}
}
Loading