summaryrefslogtreecommitdiffstats
path: root/drivers/md/raid5.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-08-23 19:10:28 +0200
committerJens Axboe <axboe@kernel.dk>2017-08-23 12:49:49 -0600
commit10433d04b8e647a50feffec72fd3cf40ce42b084 (patch)
tree39ad0c086e96568043919437f5571bc223b3033c /drivers/md/raid5.c
parentf8f84b2dfda5a74c56536a9e9092d2a5d761db78 (diff)
downloadlinux-10433d04b8e647a50feffec72fd3cf40ce42b084.tar.gz
linux-10433d04b8e647a50feffec72fd3cf40ce42b084.tar.bz2
linux-10433d04b8e647a50feffec72fd3cf40ce42b084.zip
raid5: remove a call to get_start_sect
The block layer always remaps partitions before calling into the ->make_request methods of drivers. Thus the call to get_start_sect in in_chunk_boundary will always return 0 and can be removed. Reviewed-by: Shaohua Li <shli@fb.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/md/raid5.c')
-rw-r--r--drivers/md/raid5.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 0fc2748aaf95..d687aeb1b538 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -5092,10 +5092,12 @@ static int raid5_congested(struct mddev *mddev, int bits)
static int in_chunk_boundary(struct mddev *mddev, struct bio *bio)
{
struct r5conf *conf = mddev->private;
- sector_t sector = bio->bi_iter.bi_sector + get_start_sect(bio->bi_bdev);
+ sector_t sector = bio->bi_iter.bi_sector;
unsigned int chunk_sectors;
unsigned int bio_sectors = bio_sectors(bio);
+ WARN_ON_ONCE(bio->bi_partno);
+
chunk_sectors = min(conf->chunk_sectors, conf->prev_chunk_sectors);
return chunk_sectors >=
((sector & (chunk_sectors - 1)) + bio_sectors);