Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4606947rdb; Tue, 12 Dec 2023 04:39:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IHwtEnTPRcoS3DejLz9jbVJgAB0JPTlKRITuOMjO12xo4Yp1TcSi9978h7xQD10Wr9OYcqR X-Received: by 2002:a17:90b:17c3:b0:286:cc3d:9df8 with SMTP id me3-20020a17090b17c300b00286cc3d9df8mr4574874pjb.16.1702384761911; Tue, 12 Dec 2023 04:39:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702384761; cv=none; d=google.com; s=arc-20160816; b=mMCWcI+wA7VkXu9itLMwkOabGDWKTh64eydg/PDV5eJAHzqSU75ma5fuPzJDDv5HCz /zpeKxQBu1zS6QX4Jrm0br/GWusnZMXScQJk8mHdR5gKOUsfPLstfT/L64H5h9ObpMNm pExn01XUFVR9IyfeWHtHInyW4Q32w1R+sVqGyee1+X5T6qqsGmIHkJdwt3F3HIn1HxDH R9qRrlKBmMQJCQa1Jiv4BI8MxG+I82nNvINqx0xvzXEksJ9NiIpBVMe50+Ew9Fmd05aJ oCULGIG1rjqQ1XjD0unZE3SI/jsg+7NRStTwIzVe15+W6hUC5vD18itupo8bW1VvUbAP sIlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :wdcironportexception:ironport-sdr:ironport-sdr:dkim-signature; bh=At+hls3D6DBQLKNLgMK3qn7xHxqvXh3uB5AMaLua6jM=; fh=RkzPy8j9Bgyvxc5aNhoOEUjthII6WQwvTfVAiEIVvUg=; b=CbAvDppvOQOAiH0/zRjidf0jmQXrudDFWUFdOvgkyHgphkvAkIRu1aGLCldNug7U9W WDh8Vyj0cFho+ZsFrwfMVy/tEJLZPgA98V8x6nQLPVl0TcIyp9zq7h2/R9Qde/rD7bBA drn4AFTnjoRjbYaPksnqhd5RZ3wIiH+ot4n3k3c1g79LudL25rE9iYFN8YZ/EYk+EVzS B4It95bYaT/TzA9B6vUptdvR8jSay1rvuycns1UkR4x2x2i9hxrCTybj16TG5DQdB3vB odzqKIuvD1MuTBVi6fPBSb0bLBwTwHEkz4EK0VVp0G6rOAH29s5EdLJQM245dZE4Atw6 VyqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=HpJqw8zq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id ix11-20020a170902f80b00b001bdcd2e1706si7812532plb.196.2023.12.12.04.39.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 04:39:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=HpJqw8zq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 7E1C3804C51E; Tue, 12 Dec 2023 04:39:19 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346720AbjLLMjD (ORCPT + 99 others); Tue, 12 Dec 2023 07:39:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346713AbjLLMii (ORCPT ); Tue, 12 Dec 2023 07:38:38 -0500 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FDDB1AE; Tue, 12 Dec 2023 04:38:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1702384716; x=1733920716; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=m+k8zZj7fOiwTsk10O7T+w0cafCSoG6d6aneRjaYfXI=; b=HpJqw8zqjpnIcr6+/FtBRwUNWkzc/ONLklWqRpLVv7gvMq75ktQzGZhD XrvAUHcEHZgswvBUWDKBrbHWLMgNYAspFAlD1u2QFL2zllRPkDRBSxRCM +KL4hx3y4KMvQc77sXJgu1EQeU2buOdAsk2nbRoTD8orqfTzzyHFj3pQ6 vUz/zAJg4VATn8dlx5H8BAtYzjhdWCzt4GVCOy7qiVuUcTUHet/OG21og 9VI8eGRuvss/aZSwcckhzEq0sMDxV0+KCy9Sd6ilqYs/g+AzC8ExEjhph 5JNLhyU3JNtfFLiH3f/G+NV1iSC3Mo2gOHDsV7ETtM1YXU6Fwi09zm6GP A==; X-CSE-ConnectionGUID: IOXfBpj9SzmwLK28ikQpeA== X-CSE-MsgGUID: zlpYzwIKTPeDpf7laSGAUg== X-IronPort-AV: E=Sophos;i="6.04,270,1695657600"; d="scan'208";a="4629805" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 12 Dec 2023 20:38:28 +0800 IronPort-SDR: EEZx+MTXO5/EPfiEE0Oqo3Y+V7UigsN4Syyf7I8P7QAy9DwuxGXUslS55HOyNj4viY/v4jWdYb Pj/lRF0LEBig== Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 12 Dec 2023 03:43:41 -0800 IronPort-SDR: fsU/wqkD+KVd+7gZJQZyM/42QDym7jl2WKEY8ZV6rVeYnw/77LWRt4Ax0M273k/kZL5F6hMNBT 2pCl9aEMoPag== WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip02.wdc.com with ESMTP; 12 Dec 2023 04:38:27 -0800 From: Johannes Thumshirn Date: Tue, 12 Dec 2023 04:38:09 -0800 Subject: [PATCH 11/13] btrfs: open code set_io_stripe for RAID56 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20231212-btrfs_map_block-cleanup-v1-11-b2d954d9a55b@wdc.com> References: <20231212-btrfs_map_block-cleanup-v1-0-b2d954d9a55b@wdc.com> In-Reply-To: <20231212-btrfs_map_block-cleanup-v1-0-b2d954d9a55b@wdc.com> To: Chris Mason , Josef Bacik , David Sterba Cc: linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org, Johannes Thumshirn X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1702384691; l=1349; i=johannes.thumshirn@wdc.com; s=20230613; h=from:subject:message-id; bh=m+k8zZj7fOiwTsk10O7T+w0cafCSoG6d6aneRjaYfXI=; b=xbO8DGuIlP9LDF+dOqBn9tQlgUQ3uaT19PWrwV0MrDVeQCBR9suWMeo8QrFScmaHU0ztpPxSS q8Vd2PG2TF4Dgo7pmaOOJKF9oElSi9Vsvn0xWedCUaDzEeKjv3OAlu3 X-Developer-Key: i=johannes.thumshirn@wdc.com; a=ed25519; pk=TGmHKs78FdPi+QhrViEvjKIGwReUGCfa+3LEnGoR2KM= X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 12 Dec 2023 04:39:19 -0800 (PST) Open code set_io_stripe() for RAID56, as it a) uses a different method to calculate the stripe_index and b) doesn't need to go through raid-stripe-tree mapping code. Signed-off-by: Johannes Thumshirn --- fs/btrfs/volumes.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index 946333c8c331..7df991a81c4b 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c @@ -6670,13 +6670,16 @@ int btrfs_map_block(struct btrfs_fs_info *fs_info, enum btrfs_map_op op, btrfs_stripe_nr_to_offset(io_geom.stripe_nr * nr_data_stripes(map)); for (int i = 0; i < io_geom.num_stripes; i++) { - ret = set_io_stripe(fs_info, op, logical, length, - &bioc->stripes[i], map, - (i + io_geom.stripe_nr) % io_geom.num_stripes, - io_geom.stripe_offset, - io_geom.stripe_nr); - if (ret < 0) - break; + struct btrfs_io_stripe *dst = &bioc->stripes[i]; + u32 stripe_index; + + stripe_index = + (i + io_geom.stripe_nr) % io_geom.num_stripes; + dst->dev = map->stripes[stripe_index].dev; + dst->physical = + map->stripes[stripe_index].physical + + io_geom.stripe_offset + + btrfs_stripe_nr_to_offset(io_geom.stripe_nr); } } else { /* -- 2.43.0