aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/raid0.c
diff options
context:
space:
mode:
authorKent Overstreet <koverstreet@google.com>2013-02-05 18:19:29 -0500
committerKent Overstreet <koverstreet@google.com>2013-03-23 17:15:30 -0400
commitaa8b57aa3d1c06ca53312294ee6dfc767ee3ddb3 (patch)
treea5921d44756d32e0555a8ae284db3c16a8386860 /drivers/md/raid0.c
parentf73a1c7d117d07a96d89475066188a2b79e53c48 (diff)
block: Use bio_sectors() more consistently
Bunch of places in the code weren't using it where they could be - this'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: "Ed L. Cashin" <ecashin@coraid.com> CC: Nick Piggin <npiggin@kernel.dk> CC: Jiri Kosina <jkosina@suse.cz> CC: Jim Paris <jim@jtan.com> CC: Geoff Levand <geoff@infradead.org> CC: Alasdair Kergon <agk@redhat.com> CC: dm-devel@redhat.com CC: Neil Brown <neilb@suse.de> CC: Steven Rostedt <rostedt@goodmis.org> Acked-by: Ed Cashin <ecashin@coraid.com>
Diffstat (limited to 'drivers/md/raid0.c')
-rw-r--r--drivers/md/raid0.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index 0505452de8d6..23a38afec351 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -502,11 +502,11 @@ static inline int is_io_in_chunk_boundary(struct mddev *mddev,
502{ 502{
503 if (likely(is_power_of_2(chunk_sects))) { 503 if (likely(is_power_of_2(chunk_sects))) {
504 return chunk_sects >= ((bio->bi_sector & (chunk_sects-1)) 504 return chunk_sects >= ((bio->bi_sector & (chunk_sects-1))
505 + (bio->bi_size >> 9)); 505 + bio_sectors(bio));
506 } else{ 506 } else{
507 sector_t sector = bio->bi_sector; 507 sector_t sector = bio->bi_sector;
508 return chunk_sects >= (sector_div(sector, chunk_sects) 508 return chunk_sects >= (sector_div(sector, chunk_sects)
509 + (bio->bi_size >> 9)); 509 + bio_sectors(bio));
510 } 510 }
511} 511}
512 512
@@ -567,7 +567,7 @@ bad_map:
567 printk("md/raid0:%s: make_request bug: can't convert block across chunks" 567 printk("md/raid0:%s: make_request bug: can't convert block across chunks"
568 " or bigger than %dk %llu %d\n", 568 " or bigger than %dk %llu %d\n",
569 mdname(mddev), chunk_sects / 2, 569 mdname(mddev), chunk_sects / 2,
570 (unsigned long long)bio->bi_sector, bio->bi_size >> 10); 570 (unsigned long long)bio->bi_sector, bio_sectors(bio) / 2);
571 571
572 bio_io_error(bio); 572 bio_io_error(bio);
573 return; 573 return;