diff options
author | Kent Overstreet <koverstreet@google.com> | 2012-09-25 18:05:12 -0400 |
---|---|---|
committer | Kent Overstreet <koverstreet@google.com> | 2013-03-23 17:15:29 -0400 |
commit | f73a1c7d117d07a96d89475066188a2b79e53c48 (patch) | |
tree | b2343926df6cf7877ee398ba485a962148b67804 /block | |
parent | fb9e3534768c1daa0bd09dd00d1a8828e15079c8 (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 'block')
-rw-r--r-- | block/blk-core.c | 2 | ||||
-rw-r--r-- | block/cfq-iosched.c | 7 | ||||
-rw-r--r-- | block/deadline-iosched.c | 2 |
3 files changed, 4 insertions, 7 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 86a1afeef606..7236b826f4a1 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -1586,7 +1586,7 @@ static void handle_bad_sector(struct bio *bio) | |||
1586 | printk(KERN_INFO "%s: rw=%ld, want=%Lu, limit=%Lu\n", | 1586 | printk(KERN_INFO "%s: rw=%ld, want=%Lu, limit=%Lu\n", |
1587 | bdevname(bio->bi_bdev, b), | 1587 | bdevname(bio->bi_bdev, b), |
1588 | bio->bi_rw, | 1588 | bio->bi_rw, |
1589 | (unsigned long long)bio->bi_sector + bio_sectors(bio), | 1589 | (unsigned long long)bio_end_sector(bio), |
1590 | (long long)(i_size_read(bio->bi_bdev->bd_inode) >> 9)); | 1590 | (long long)(i_size_read(bio->bi_bdev->bd_inode) >> 9)); |
1591 | 1591 | ||
1592 | set_bit(BIO_EOF, &bio->bi_flags); | 1592 | set_bit(BIO_EOF, &bio->bi_flags); |
diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 4f0ade74cfd0..d5cd3131c57a 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c | |||
@@ -2270,11 +2270,8 @@ cfq_find_rq_fmerge(struct cfq_data *cfqd, struct bio *bio) | |||
2270 | return NULL; | 2270 | return NULL; |
2271 | 2271 | ||
2272 | cfqq = cic_to_cfqq(cic, cfq_bio_sync(bio)); | 2272 | cfqq = cic_to_cfqq(cic, cfq_bio_sync(bio)); |
2273 | if (cfqq) { | 2273 | if (cfqq) |
2274 | sector_t sector = bio->bi_sector + bio_sectors(bio); | 2274 | return elv_rb_find(&cfqq->sort_list, bio_end_sector(bio)); |
2275 | |||
2276 | return elv_rb_find(&cfqq->sort_list, sector); | ||
2277 | } | ||
2278 | 2275 | ||
2279 | return NULL; | 2276 | return NULL; |
2280 | } | 2277 | } |
diff --git a/block/deadline-iosched.c b/block/deadline-iosched.c index 90037b5eb17f..ba19a3afab79 100644 --- a/block/deadline-iosched.c +++ b/block/deadline-iosched.c | |||
@@ -132,7 +132,7 @@ deadline_merge(struct request_queue *q, struct request **req, struct bio *bio) | |||
132 | * check for front merge | 132 | * check for front merge |
133 | */ | 133 | */ |
134 | if (dd->front_merges) { | 134 | if (dd->front_merges) { |
135 | sector_t sector = bio->bi_sector + bio_sectors(bio); | 135 | sector_t sector = bio_end_sector(bio); |
136 | 136 | ||
137 | __rq = elv_rb_find(&dd->sort_list[bio_data_dir(bio)], sector); | 137 | __rq = elv_rb_find(&dd->sort_list[bio_data_dir(bio)], sector); |
138 | if (__rq) { | 138 | if (__rq) { |