Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757893AbbEVSWn (ORCPT ); Fri, 22 May 2015 14:22:43 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:16176 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757431AbbEVST2 (ORCPT ); Fri, 22 May 2015 14:19:28 -0400 X-AuditID: cbfee61a-f79516d000006302-42-555f732d2afd From: Ming Lin To: linux-kernel@vger.kernel.org Cc: Christoph Hellwig , Kent Overstreet , Jens Axboe , Dongsu Park , Ming Lin , Neil Brown , linux-raid@vger.kernel.org Subject: [PATCH v4 06/11] md/raid5: get rid of bio_fits_rdev() Date: Fri, 22 May 2015 11:18:38 -0700 Message-id: <1432318723-18829-7-git-send-email-mlin@kernel.org> X-Mailer: git-send-email 1.9.1 In-reply-to: <1432318723-18829-1-git-send-email-mlin@kernel.org> References: <1432318723-18829-1-git-send-email-mlin@kernel.org> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHLMWRmVeSWpSXmKPExsVy+t9jAV3d4vhQg7f3DS1W3+1ns9gx4ymT xcrVR5ksjjRVWVzeNYfNon3+LkaL89tOslrsnd/A4sDhsXPWXXaPy2dLPTat6mTz2H2zgc3j 8eGT7B6bT1d7fN4kF8AexWWTkpqTWZZapG+XwJVx59ZEtoLZ/BVTm/azNDAe4Oli5OSQEDCR +Hp1ETOELSZx4d56ti5GLg4hgUWMEr27p7FAOD8ZJdb0nmIFqWITUJA4uG4DE4gtAmRv7n0G FmcWeM4osf1KNogtLGAnsWX+IqAaDg4WAVWJWcu5QcK8AvYSx7bfZ4dYJidx8thkVpASTgEH id27PEDCQkAl69bNZZzAyLuAkWEVo2hqQXJBcVJ6rqFecWJucWleul5yfu4mRnCoPZPawbiy weIQowAHoxIPr8HBuFAh1sSy4srcQ4wSHMxKIry6fvGhQrwpiZVVqUX58UWlOanFhxilOViU xHlP5vuECgmkJ5akZqemFqQWwWSZODilGhhNE4pD2DzkJyRrf1wbZM648rPT36YaJU+mw+p7 s/3TI07mS2xfJ2RrMEv82cQLtXufKu0z3XnT2Yf7Met89Yll34ROZOjy8GhNO3hALPvdE6bW YxGXX0wQUgqdvvqSpPL3t68yNuX/+M7uwjNxWs+1NpuT6XEu9+ZVyXDXyf1PmmY0L2im4QYl luKMREMt5qLiRACmiYGAMQIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2130 Lines: 67 From: Kent Overstreet Remove bio_fits_rdev() completely, because ->merge_bvec_fn() has now gone. There's no point in calling bio_fits_rdev() only for ensuring aligned read from rdev. Cc: Neil Brown Cc: linux-raid@vger.kernel.org Signed-off-by: Kent Overstreet [dpark: add more description in commit message] Signed-off-by: Dongsu Park Signed-off-by: Ming Lin --- drivers/md/raid5.c | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 1ba97fd..b303ded 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -4743,25 +4743,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; @@ -4815,11 +4796,9 @@ static int chunk_aligned_read(struct mddev *mddev, struct bio * raid_bio) align_bi->bi_bdev = rdev->bdev; __clear_bit(BIO_SEG_VALID, &align_bi->bi_flags); - 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; -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/