Skip to content

Commit 7140aaf

Browse files
koverstreetaxboe
authored andcommitted
md/raid5: get rid of bio_fits_rdev()
Remove bio_fits_rdev() as sufficient merge_bvec_fn() handling is now performed by blk_queue_split() in md_make_request(). Cc: Neil Brown <neilb@suse.de> Cc: linux-raid@vger.kernel.org Acked-by: NeilBrown <neilb@suse.de> Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> [dpark: add more description in commit message] Signed-off-by: Dongsu Park <dpark@posteo.net> Signed-off-by: Ming Lin <ming.l@ssi.samsung.com> Signed-off-by: Jens Axboe <axboe@fb.com>
1 parent 7ef6b12 commit 7140aaf

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

drivers/md/raid5.c

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4781,25 +4781,6 @@ static void raid5_align_endio(struct bio *bi)
47814781
add_bio_to_retry(raid_bi, conf);
47824782
}
47834783

4784-
static int bio_fits_rdev(struct bio *bi)
4785-
{
4786-
struct request_queue *q = bdev_get_queue(bi->bi_bdev);
4787-
4788-
if (bio_sectors(bi) > queue_max_sectors(q))
4789-
return 0;
4790-
blk_recount_segments(q, bi);
4791-
if (bi->bi_phys_segments > queue_max_segments(q))
4792-
return 0;
4793-
4794-
if (q->merge_bvec_fn)
4795-
/* it's too hard to apply the merge_bvec_fn at this stage,
4796-
* just just give up
4797-
*/
4798-
return 0;
4799-
4800-
return 1;
4801-
}
4802-
48034784
static int raid5_read_one_chunk(struct mddev *mddev, struct bio *raid_bio)
48044785
{
48054786
struct r5conf *conf = mddev->private;
@@ -4853,11 +4834,9 @@ static int raid5_read_one_chunk(struct mddev *mddev, struct bio *raid_bio)
48534834
align_bi->bi_bdev = rdev->bdev;
48544835
bio_clear_flag(align_bi, BIO_SEG_VALID);
48554836

4856-
if (!bio_fits_rdev(align_bi) ||
4857-
is_badblock(rdev, align_bi->bi_iter.bi_sector,
4837+
if (is_badblock(rdev, align_bi->bi_iter.bi_sector,
48584838
bio_sectors(align_bi),
48594839
&first_bad, &bad_sectors)) {
4860-
/* too big in some way, or has a known bad block */
48614840
bio_put(align_bi);
48624841
rdev_dec_pending(rdev, mddev);
48634842
return 0;

0 commit comments

Comments
 (0)