From patchwork Wed Aug 23 17:10:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 9917929 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1DD63603FA for ; Wed, 23 Aug 2017 17:11:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 057C6286D1 for ; Wed, 23 Aug 2017 17:11:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED1E3286D5; Wed, 23 Aug 2017 17:11:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 89CC1288D1 for ; Wed, 23 Aug 2017 17:11:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932393AbdHWRKr (ORCPT ); Wed, 23 Aug 2017 13:10:47 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:49191 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932204AbdHWRKo (ORCPT ); Wed, 23 Aug 2017 13:10:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5tnUwZIiQNSVXpCwrjzD3RFPeFwOBDwWgRHK8PeqxCM=; b=eDy7hX3XgwRU8VFHXnXrH9Xqx JrQDftxDpX9WqpmixinizHeo0toK8+Whkxbiag1PmWj3Fzt5u4gUaUYYva2+08cc6btwkqLO1R2bx alNu0787eBMStrXX1WD0SDO2OrdEXVybMXTuAuUy/cl59ueInHRJuSPpGZJ28odxdHvMVL+/H9nNe njXfSW5U6l84Sn2mwlYq6LqlKDn1hWsk/YdLwCJdXXEsp5oTKbCOcX94hbQAUZoHmocp/YfZTPReo jy4PFrOwqjUOVv/Q7RMSf9ca2pOq1tv9N5apVIwiIz+04D5T+SgilS2oDt+opjBz82UkaPewe73jp mKpSrOTUg==; Received: from clnet-p099-196.ikbnet.co.at ([83.175.99.196] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.87 #1 (Red Hat Linux)) id 1dkZAx-0007Xp-6A; Wed, 23 Aug 2017 17:10:43 +0000 From: Christoph Hellwig To: Jens Axboe Cc: linux-block@vger.kernel.org, linux-raid@vger.kernel.org, linux-btrfs@vger.kernel.org Subject: [PATCH 2/6] raid5: remove a call to get_start_sect Date: Wed, 23 Aug 2017 19:10:28 +0200 Message-Id: <20170823171032.30529-3-hch@lst.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170823171032.30529-1-hch@lst.de> References: <20170823171032.30529-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Christoph Hellwig Reviewed-by: Shaohua Li --- drivers/md/raid5.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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);