summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-09-25 13:37:01 -0700
committerKent Overstreet <kmo@daterainc.com>2014-06-17 18:25:57 -0700
commita2de16f0cb5619a6551cad2c11904c4a6ced4198 (patch)
tree8445d8a5a91f1d17c9f0bbf9b9ca2c3d65a62a4b
parent5064c8a8b54d4a78b55d959ab30ab222548bea9a (diff)
raid5: kill bio_fits_rdev()
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
-rw-r--r--drivers/md/raid5.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 6234b2e84587..eb575ba69d8d 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -4224,26 +4224,6 @@ static void raid5_align_endio(struct bio *bi, int error)
add_bio_to_retry(raid_bi, conf);
}
-static int bio_fits_rdev(struct bio *bi)
-{
- struct request_queue *q = bdev_get_queue(bi->bi_bdev);
-
- if (bio_sectors(bi) > queue_max_sectors(q))
- return 0;
- blk_recount_segments(q, bi);
- if (bi->bi_phys_segments > queue_max_segments(q))
- return 0;
-
- if (q->merge_bvec_fn)
- /* it's too hard to apply the merge_bvec_fn at this stage,
- * just just give up
- */
- return 0;
-
- return 1;
-}
-
-
static int chunk_aligned_read(struct mddev *mddev, struct bio * raid_bio)
{
struct r5conf *conf = mddev->private;
@@ -4297,11 +4277,9 @@ static int chunk_aligned_read(struct mddev *mddev, struct bio * raid_bio)
align_bi->bi_bdev = rdev->bdev;
align_bi->bi_flags &= ~(1 << BIO_SEG_VALID);
- if (!bio_fits_rdev(align_bi) ||
- is_badblock(rdev, align_bi->bi_iter.bi_sector,
+ if (is_badblock(rdev, align_bi->bi_iter.bi_sector,
bio_sectors(align_bi),
&first_bad, &bad_sectors)) {
- /* too big in some way, or has a known bad block */
bio_put(align_bi);
rdev_dec_pending(rdev, mddev);
return 0;