summaryrefslogtreecommitdiffstats
path: root/drivers/block/pktcdvd.c
diff options
context:
space:
mode:
authorKent Overstreet <koverstreet@google.com>2012-09-25 18:05:12 -0400
committerKent Overstreet <koverstreet@google.com>2013-03-23 17:15:29 -0400
commitf73a1c7d117d07a96d89475066188a2b79e53c48 (patch)
treeb2343926df6cf7877ee398ba485a962148b67804 /drivers/block/pktcdvd.c
parentfb9e3534768c1daa0bd09dd00d1a8828e15079c8 (diff)
block: Add bio_end_sector()
Just a little convenience macro - main reason to add it now is preparing for immutable bio vecs, it'll reduce the size of the patch that puts bi_sector/bi_size/bi_idx into a struct bvec_iter. Signed-off-by: Kent Overstreet <koverstreet@google.com> CC: Jens Axboe <axboe@kernel.dk> CC: Lars Ellenberg <drbd-dev@lists.linbit.com> CC: Jiri Kosina <jkosina@suse.cz> CC: Alasdair Kergon <agk@redhat.com> CC: dm-devel@redhat.com CC: Neil Brown <neilb@suse.de> CC: Martin Schwidefsky <schwidefsky@de.ibm.com> CC: Heiko Carstens <heiko.carstens@de.ibm.com> CC: linux-s390@vger.kernel.org CC: Chris Mason <chris.mason@fusionio.com> CC: Steven Whitehouse <swhiteho@redhat.com> Acked-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'drivers/block/pktcdvd.c')
-rw-r--r--drivers/block/pktcdvd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 2e7de7a59bfc..26938e8e2fc3 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -901,7 +901,7 @@ static void pkt_iosched_process_queue(struct pktcdvd_device *pd)
901 pd->iosched.successive_reads += bio->bi_size >> 10; 901 pd->iosched.successive_reads += bio->bi_size >> 10;
902 else { 902 else {
903 pd->iosched.successive_reads = 0; 903 pd->iosched.successive_reads = 0;
904 pd->iosched.last_write = bio->bi_sector + bio_sectors(bio); 904 pd->iosched.last_write = bio_end_sector(bio);
905 } 905 }
906 if (pd->iosched.successive_reads >= HI_SPEED_SWITCH) { 906 if (pd->iosched.successive_reads >= HI_SPEED_SWITCH) {
907 if (pd->read_speed == pd->write_speed) { 907 if (pd->read_speed == pd->write_speed) {
@@ -2454,7 +2454,7 @@ static void pkt_make_request(struct request_queue *q, struct bio *bio)
2454 zone = ZONE(bio->bi_sector, pd); 2454 zone = ZONE(bio->bi_sector, pd);
2455 VPRINTK("pkt_make_request: start = %6llx stop = %6llx\n", 2455 VPRINTK("pkt_make_request: start = %6llx stop = %6llx\n",
2456 (unsigned long long)bio->bi_sector, 2456 (unsigned long long)bio->bi_sector,
2457 (unsigned long long)(bio->bi_sector + bio_sectors(bio))); 2457 (unsigned long long)bio_end_sector(bio));
2458 2458
2459 /* Check if we have to split the bio */ 2459 /* Check if we have to split the bio */
2460 { 2460 {
@@ -2462,7 +2462,7 @@ static void pkt_make_request(struct request_queue *q, struct bio *bio)
2462 sector_t last_zone; 2462 sector_t last_zone;
2463 int first_sectors; 2463 int first_sectors;
2464 2464
2465 last_zone = ZONE(bio->bi_sector + bio_sectors(bio) - 1, pd); 2465 last_zone = ZONE(bio_end_sector(bio) - 1, pd);
2466 if (last_zone != zone) { 2466 if (last_zone != zone) {
2467 BUG_ON(last_zone != zone + pd->settings.size); 2467 BUG_ON(last_zone != zone + pd->settings.size);
2468 first_sectors = last_zone - bio->bi_sector; 2468 first_sectors = last_zone - bio->bi_sector;