From patchwork Wed Oct 4 07:56:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13408299 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A486BE8FDD9 for ; Wed, 4 Oct 2023 07:56:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241594AbjJDH4b (ORCPT ); Wed, 4 Oct 2023 03:56:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45382 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241603AbjJDH42 (ORCPT ); Wed, 4 Oct 2023 03:56:28 -0400 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1555A7; Wed, 4 Oct 2023 00:56:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1696406184; x=1727942184; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=oOaBzvLzYxk5pgsPN1ktOBI6k/bFMn2voCQvb+dd7HM=; b=mSiSv6G4Uxc67gEh4KVdZ192IRd6d5eQc73+4UN8ImmAgoAAMUtwYISB cyR5d8HM/N+8kWcQ3khZheRrtpuJLAjkJ2ZIiBnO+reuDaCbGBJZU5A/0 tSFLpQED/+LRRcGaxxJRwDu2zD2kXrBKRi5JRJO2w21gXY42OhmgoqHu9 nn7f7ImZiqtXFmLScYpz4R7maJd+i7Qgg8qrVgiu8l/JMFBXY5Zcyo5PG YCUcc3vdbBNs9J3p68yDZkXCZrwHNoHTC67jSBYIELD3g3BezKN1s+Wjn PtLQyoGKKgNFjcPRi+v8ddDcBQ/DTM7yDjPwQ3sT0yEjKcfMoxjYRwvh5 Q==; X-CSE-ConnectionGUID: BecG0bTiR/KGmWHVRZ7o4g== X-CSE-MsgGUID: MhwPEGn7SBe0/es3kUKmEA== X-IronPort-AV: E=Sophos;i="6.03,199,1694707200"; d="scan'208";a="351024162" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 04 Oct 2023 15:56:23 +0800 IronPort-SDR: h/ICLCPZSui84k7Wty79D/LTga+m2qaYXQBU+oswB2rWBa5ztf9AlJThZUlM2bQBsBfL4mCB4g 478GcvUDhWW2MlAvHBXJwsoBZW1SbpapEcrWxN504O4zikW6GIf6u0M+GqpANg26XT7HtwUEJY 4rhoGxdDo7iyiuSmp9GodgQ+1TALdhuAls4ssnG0x8zFckyd9JtSE2+C8UQUz+HzQB6kNuLf0p EHejaiu8cvyouAsUr1naiIVCf5yF/hiRxEW8lbP+f95fAkAuq53StLMTqiOTa6y2t5FKk2Nizo 6p0= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 Oct 2023 00:03:01 -0700 IronPort-SDR: Bfe0qnoJ6OwQ3odKOmUXUgIgEH+Bk+4VDuKjaRMWwP5iRTw2BQSVf2MgJdNScI+8kesMPvoqjK sY939ms9htlVEQ2wutdMAfPUoBDJf2eBxIfise6hnKYkSZvFx1lRqMcBVdchQE56k9FWTuk/lV 9iSUctWLCNtxvE1Kk+2JKsH8jTbFXDWdvCqAPaYyDe1zANHPLOUZabxR3jek33fG4Gtkne9sL0 g4lEAGDtmk7NLBoWT7spsMuQQDoCWYeRVx+L4vGF1KykpzBRY4zakbhkRxQkCpbM/8mueLdpAZ 2Dw= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip01.wdc.com with ESMTP; 04 Oct 2023 00:56:23 -0700 From: Johannes Thumshirn Date: Wed, 04 Oct 2023 00:56:16 -0700 Subject: [PATCH v3 1/4] btrfs: change RST write MIME-Version: 1.0 Message-Id: <20231004-rst-updates-v3-1-7729c4474ade@wdc.com> References: <20231004-rst-updates-v3-0-7729c4474ade@wdc.com> In-Reply-To: <20231004-rst-updates-v3-0-7729c4474ade@wdc.com> To: Chris Mason , Josef Bacik , David Sterba Cc: Qu Wenru , Damien Le Moal , Naohiro Aota , 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=1696406180; l=6579; i=johannes.thumshirn@wdc.com; s=20230613; h=from:subject:message-id; bh=oOaBzvLzYxk5pgsPN1ktOBI6k/bFMn2voCQvb+dd7HM=; b=4odRZdfbn24hd6VqjX85IQeOKsxFxDe1OKzkyhb2LUgii50StBOu5f35vRzt+MB7xRjxBaeG3 OzDug3jhT1wCafx5VEivIGndBQ9szzW+B65s1nmLXgzKUfJJG0UvfUj X-Developer-Key: i=johannes.thumshirn@wdc.com; a=ed25519; pk=TGmHKs78FdPi+QhrViEvjKIGwReUGCfa+3LEnGoR2KM= Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Signed-off-by: Johannes Thumshirn --- fs/btrfs/raid-stripe-tree.c | 165 ++------------------------------------------ 1 file changed, 5 insertions(+), 160 deletions(-) diff --git a/fs/btrfs/raid-stripe-tree.c b/fs/btrfs/raid-stripe-tree.c index 8a38f07a3246..248e048810d3 100644 --- a/fs/btrfs/raid-stripe-tree.c +++ b/fs/btrfs/raid-stripe-tree.c @@ -75,12 +75,12 @@ int btrfs_delete_raid_extent(struct btrfs_trans_handle *trans, u64 start, u64 le } static int btrfs_insert_one_raid_extent(struct btrfs_trans_handle *trans, - int num_stripes, struct btrfs_io_context *bioc) { struct btrfs_fs_info *fs_info = trans->fs_info; struct btrfs_key stripe_key; struct btrfs_root *stripe_root = fs_info->stripe_root; + const int num_stripes = btrfs_bg_type_to_factor(bioc->map_type); u8 encoding = btrfs_bg_flags_to_raid_index(bioc->map_type); struct btrfs_stripe_extent *stripe_extent; const size_t item_size = struct_size(stripe_extent, strides, num_stripes); @@ -107,7 +107,6 @@ static int btrfs_insert_one_raid_extent(struct btrfs_trans_handle *trans, btrfs_set_stack_raid_stride_devid(raid_stride, devid); btrfs_set_stack_raid_stride_physical(raid_stride, physical); - btrfs_set_stack_raid_stride_length(raid_stride, length); } stripe_key.objectid = bioc->logical; @@ -124,173 +123,19 @@ static int btrfs_insert_one_raid_extent(struct btrfs_trans_handle *trans, return ret; } -static int btrfs_insert_mirrored_raid_extents(struct btrfs_trans_handle *trans, - struct btrfs_ordered_extent *ordered, - u64 map_type) -{ - int num_stripes = btrfs_bg_type_to_factor(map_type); - struct btrfs_io_context *bioc; - int ret; - - list_for_each_entry(bioc, &ordered->bioc_list, rst_ordered_entry) { - ret = btrfs_insert_one_raid_extent(trans, num_stripes, bioc); - if (ret) - return ret; - } - - return 0; -} - -static int btrfs_insert_striped_mirrored_raid_extents( - struct btrfs_trans_handle *trans, - struct btrfs_ordered_extent *ordered, - u64 map_type) -{ - struct btrfs_io_context *bioc; - struct btrfs_io_context *rbioc; - const size_t nstripes = list_count_nodes(&ordered->bioc_list); - const enum btrfs_raid_types index = btrfs_bg_flags_to_raid_index(map_type); - const int substripes = btrfs_raid_array[index].sub_stripes; - const int max_stripes = div_u64(trans->fs_info->fs_devices->rw_devices, - substripes); - int left = nstripes; - int i; - int ret = 0; - u64 stripe_end; - u64 prev_end; - int stripe; - - if (nstripes == 1) - return btrfs_insert_mirrored_raid_extents(trans, ordered, map_type); - - rbioc = kzalloc(struct_size(rbioc, stripes, nstripes * substripes), GFP_NOFS); - if (!rbioc) - return -ENOMEM; - - rbioc->map_type = map_type; - rbioc->logical = list_first_entry(&ordered->bioc_list, typeof(*rbioc), - rst_ordered_entry)->logical; - - stripe_end = rbioc->logical; - prev_end = stripe_end; - i = 0; - stripe = 0; - list_for_each_entry(bioc, &ordered->bioc_list, rst_ordered_entry) { - rbioc->size += bioc->size; - for (int j = 0; j < substripes; j++) { - stripe = i + j; - rbioc->stripes[stripe].dev = bioc->stripes[j].dev; - rbioc->stripes[stripe].physical = bioc->stripes[j].physical; - rbioc->stripes[stripe].length = bioc->size; - } - - stripe_end += rbioc->size; - if (i >= nstripes || - (stripe_end - prev_end >= max_stripes * BTRFS_STRIPE_LEN)) { - ret = btrfs_insert_one_raid_extent(trans, stripe + 1, rbioc); - if (ret) - goto out; - - left -= stripe + 1; - if (left <= 0) - break; - - i = 0; - rbioc->logical += rbioc->size; - rbioc->size = 0; - } else { - i += substripes; - prev_end = stripe_end; - } - } - - if (left > 0) { - bioc = list_prev_entry(bioc, rst_ordered_entry); - ret = btrfs_insert_one_raid_extent(trans, substripes, bioc); - } - -out: - kfree(rbioc); - return ret; -} - -static int btrfs_insert_striped_raid_extents(struct btrfs_trans_handle *trans, - struct btrfs_ordered_extent *ordered, - u64 map_type) -{ - struct btrfs_io_context *bioc; - struct btrfs_io_context *rbioc; - const size_t nstripes = list_count_nodes(&ordered->bioc_list); - int i; - int ret = 0; - - rbioc = kzalloc(struct_size(rbioc, stripes, nstripes), GFP_NOFS); - if (!rbioc) - return -ENOMEM; - rbioc->map_type = map_type; - rbioc->logical = list_first_entry(&ordered->bioc_list, typeof(*rbioc), - rst_ordered_entry)->logical; - - i = 0; - list_for_each_entry(bioc, &ordered->bioc_list, rst_ordered_entry) { - rbioc->size += bioc->size; - rbioc->stripes[i].dev = bioc->stripes[0].dev; - rbioc->stripes[i].physical = bioc->stripes[0].physical; - rbioc->stripes[i].length = bioc->size; - - if (i == nstripes - 1) { - ret = btrfs_insert_one_raid_extent(trans, nstripes, rbioc); - if (ret) - goto out; - - i = 0; - rbioc->logical += rbioc->size; - rbioc->size = 0; - } else { - i++; - } - } - - if (i && i < nstripes - 1) - ret = btrfs_insert_one_raid_extent(trans, i, rbioc); - -out: - kfree(rbioc); - return ret; -} - int btrfs_insert_raid_extent(struct btrfs_trans_handle *trans, struct btrfs_ordered_extent *ordered_extent) { struct btrfs_io_context *bioc; - u64 map_type; int ret; if (!btrfs_fs_incompat(trans->fs_info, RAID_STRIPE_TREE)) return 0; - map_type = list_first_entry(&ordered_extent->bioc_list, typeof(*bioc), - rst_ordered_entry)->map_type; - - switch (map_type & BTRFS_BLOCK_GROUP_PROFILE_MASK) { - case BTRFS_BLOCK_GROUP_DUP: - case BTRFS_BLOCK_GROUP_RAID1: - case BTRFS_BLOCK_GROUP_RAID1C3: - case BTRFS_BLOCK_GROUP_RAID1C4: - ret = btrfs_insert_mirrored_raid_extents(trans, ordered_extent, map_type); - break; - case BTRFS_BLOCK_GROUP_RAID0: - ret = btrfs_insert_striped_raid_extents(trans, ordered_extent, map_type); - break; - case BTRFS_BLOCK_GROUP_RAID10: - ret = btrfs_insert_striped_mirrored_raid_extents(trans, ordered_extent, - map_type); - break; - default: - btrfs_err(trans->fs_info, "trying to insert unknown block group profile %lld", - map_type & BTRFS_BLOCK_GROUP_PROFILE_MASK); - ret = -EINVAL; - break; + list_for_each_entry(bioc, &ordered_extent->bioc_list, rst_ordered_entry) { + ret = btrfs_insert_one_raid_extent(trans, bioc); + if (ret) + return ret; } while (!list_empty(&ordered_extent->bioc_list)) { From patchwork Wed Oct 4 07:56:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13408300 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95468E8FDD1 for ; Wed, 4 Oct 2023 07:56:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241620AbjJDH4c (ORCPT ); Wed, 4 Oct 2023 03:56:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241605AbjJDH42 (ORCPT ); Wed, 4 Oct 2023 03:56:28 -0400 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 353A6AC; Wed, 4 Oct 2023 00:56:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1696406185; x=1727942185; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=+rpwer5aJHTGV8tKBiNFMEqa/oSZvlhrh7ptZ83X8Hs=; b=eQiVDOKoSnRQu27G1Q63LSg3EyHo3/QY+DxnTdRTnYX5mAYLEQYcw/j+ wXehgeBO+JR2kVcyj8C5Bqzd6vzZ7fMA89U2GgjNLpL6zxpMbXW2LyCPb feXVTh1u5+wX2wZKJtt94UHdRQY5fWT068gnqBccZz1pEs4/avMbpP1qo fgIt4SP9HflujXHR8p6IItoKpm/mUHtjsp4Im+5TyNqHcNAmEHGBDCdzs fFGePOh+9oZ2+XHi0ZjwEGBs+zxZ+qNeP1kcNKoJcH+KUXTQhubnGhCUh x+eMJ9HqhFO5Q25r+BhtOdQO8WlISr3ppz/b1iitsPZd9sIp4W7fCODwO g==; X-CSE-ConnectionGUID: 0BTl8Gs3RvCsybL0Dv/UhQ== X-CSE-MsgGUID: YAQdQu+nSrSLEb6SX85/AQ== X-IronPort-AV: E=Sophos;i="6.03,199,1694707200"; d="scan'208";a="351024164" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 04 Oct 2023 15:56:24 +0800 IronPort-SDR: lEn3nUO0s1/ih0kKKjXXW+hZDe7B1CTR1i2pRqP++iZSRnHVjqezNHrZgXgHZ/Nh0dSvwZ3+nd b7HCUdKpdHOkemxuYET1MglVtLAfkxyeUNPbs+cFpjBydBZCVeRCTvXyaKrCNXxEx//NZRpDi8 0erAEVl4aFJsDXGqloR2pcADE4RrmlDCJQKupA85L2eWtWvkBQDRHBYorUNyRwgMtQnAxTJh3b ncjuTpb4Fq07WgQcHHdwXforR3/AKgp7k+/voK1//cuWCyOAnUieNiMYVCCa6If1NiKjVVQPW/ NOo= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 Oct 2023 00:03:02 -0700 IronPort-SDR: GdLfE7MqiqgQ5NE0Qwt6Z/UiQy9GUgSqF2KqMRFJTBePsObtVcO2yZ7AvAMg/6dxu4AW0TwdrB 6MTEeb0akGEjAVWapE8Qxp5yYkiiDe6dD/dSCtHyad+SaOnmxnPnehAardjsn8/07iL2xf+76U hyZ/n/roguX7s9d+N9xsMHNbeQjosnF6obI4OJ7pyHI1HIg0uN4fqpqQxZh2Ex/sdzUoOgP6cq w2xD7tKWthuBy3bKmR/3qJMM11EJAY/hqeNCILbE9TcBbtvpxfPwn/IJ5BWBRDyBCeHo8CwOmT S8w= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip01.wdc.com with ESMTP; 04 Oct 2023 00:56:24 -0700 From: Johannes Thumshirn Date: Wed, 04 Oct 2023 00:56:17 -0700 Subject: [PATCH v3 2/4] btrfs: remove stride length check on read MIME-Version: 1.0 Message-Id: <20231004-rst-updates-v3-2-7729c4474ade@wdc.com> References: <20231004-rst-updates-v3-0-7729c4474ade@wdc.com> In-Reply-To: <20231004-rst-updates-v3-0-7729c4474ade@wdc.com> To: Chris Mason , Josef Bacik , David Sterba Cc: Qu Wenru , Damien Le Moal , Naohiro Aota , 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=1696406180; l=879; i=johannes.thumshirn@wdc.com; s=20230613; h=from:subject:message-id; bh=+rpwer5aJHTGV8tKBiNFMEqa/oSZvlhrh7ptZ83X8Hs=; b=9hiIY4SWywRd+xkjGxXBtyXHIbTYuXF2rdSQFRyKyaykhcSRR6adSUIXXNeY4559N3vZWbQxr dtvil4DqvckBaMQBMdVJqHT817/W+TOLTEkOD5UahXQti+U6fngK39g X-Developer-Key: i=johannes.thumshirn@wdc.com; a=ed25519; pk=TGmHKs78FdPi+QhrViEvjKIGwReUGCfa+3LEnGoR2KM= Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Signed-off-by: Johannes Thumshirn --- fs/btrfs/raid-stripe-tree.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/fs/btrfs/raid-stripe-tree.c b/fs/btrfs/raid-stripe-tree.c index 248e048810d3..944e8f1862aa 100644 --- a/fs/btrfs/raid-stripe-tree.c +++ b/fs/btrfs/raid-stripe-tree.c @@ -237,16 +237,8 @@ int btrfs_get_raid_extent_offset(struct btrfs_fs_info *fs_info, for (int i = 0; i < num_stripes; i++) { struct btrfs_raid_stride *stride = &stripe_extent->strides[i]; u64 devid = btrfs_raid_stride_devid(leaf, stride); - u64 len = btrfs_raid_stride_length(leaf, stride); u64 physical = btrfs_raid_stride_physical(leaf, stride); - if (offset >= len) { - offset -= len; - - if (offset >= BTRFS_STRIPE_LEN) - continue; - } - if (devid != stripe->dev->devid) continue; From patchwork Wed Oct 4 07:56:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13408302 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADBB0E8FDD1 for ; Wed, 4 Oct 2023 07:56:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241638AbjJDH4f (ORCPT ); Wed, 4 Oct 2023 03:56:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241615AbjJDH4a (ORCPT ); Wed, 4 Oct 2023 03:56:30 -0400 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46B66AD; Wed, 4 Oct 2023 00:56:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1696406186; x=1727942186; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=e+YyfDQ1PFX4rBIrEPfhcrCD3fDnJ1asPXocJQ97CxI=; b=SuLQcE6nxGiyHpczPQsdRu7srg1pvCyfnESJZ7xJksrHuayQzr7XQaOR CAwWROa/jJh7FrbDZhTOfa07hYmwJ2yp7Dn3/DM85d27rl1DP2RvCRe9Z SRjKhhLEl6TBjfBWHDMIWNu+V4WvU1hydgnWySn95U4JzrF2blK0DgQJw IBqXQi03uJqAGoPa85Z+u/fsYfC0qxNeZdDVOs71Ur9QbDAvvPBzsGz9H eukpupsziGqvnVIqSyjBWpbzSnqg9BlRZ8ximqcabJM3lrCXI8csa2yz5 wgjRECJ5JbtL2wWDrbAJsHMn8lKIcz9VmqYKSbU1fBFxPrOV1UQLqQA4l g==; X-CSE-ConnectionGUID: Rvl5g4JMQ8WH70Gv/dU9mg== X-CSE-MsgGUID: d9t3ZTI4Q3qkp4r6aaV0jQ== X-IronPort-AV: E=Sophos;i="6.03,199,1694707200"; d="scan'208";a="351024168" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 04 Oct 2023 15:56:26 +0800 IronPort-SDR: xPSh7UtJYUKBehJmvRyje1nbOEgzPNbjbs/Yzlh01XhlirqGV7UQ1XmGSZm8BoA6dlRiEJ2DJH pkwTJeE6dtU/mgjfzqXcjw/TDIjtd6VIHqlsxhg+LX4gK6XVdMfdwbTyCVE2/Tci3fwMQw0W/x +Suv6DAJpOAfGQa+wgKhFdSTsF/XWK0Y2cYpRjt8aCM1kpzpVFdHi8pnCGTJrSDvDTw7Pki/I8 /eX8lZau+C+jAkLcsLxX0m9eRKB4ArvFmJq5D3P8PHa63MjTgt79lt63RwTqLumjERo5YvDGYf b00= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 Oct 2023 00:03:04 -0700 IronPort-SDR: N503Q1l6AQ2yqCQtEZfqH3hSDxANp+eLAKJrvkCh9J4SSOIlycDddY2QJEgYBgXtXFlwMY+7yD H59TshsF7ZIJMxi9H8/8GsOI7gLaXaMbzM06/Fe/WI5l/06DtwMDYwxq3k8yxtpr0FRz1SVtSl cCNF09WcuMvjedLBeK/0HUpCbhOP+u1RSlKwlECTNaVswS0DUelCtaO1zvIzIvAo9ppUXi7s9H k2+ZoKUtU+aAULQqS/z5Wt8YKgMRg+wwYl+wVEWo2CXMn3LN9GVprzYZAnAcXoorRa/6MYW2c0 RHs= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip01.wdc.com with ESMTP; 04 Oct 2023 00:56:25 -0700 From: Johannes Thumshirn Date: Wed, 04 Oct 2023 00:56:18 -0700 Subject: [PATCH v3 3/4] btrfs: remove raid stride length in tree printer MIME-Version: 1.0 Message-Id: <20231004-rst-updates-v3-3-7729c4474ade@wdc.com> References: <20231004-rst-updates-v3-0-7729c4474ade@wdc.com> In-Reply-To: <20231004-rst-updates-v3-0-7729c4474ade@wdc.com> To: Chris Mason , Josef Bacik , David Sterba Cc: Qu Wenru , Damien Le Moal , Naohiro Aota , 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=1696406180; l=903; i=johannes.thumshirn@wdc.com; s=20230613; h=from:subject:message-id; bh=e+YyfDQ1PFX4rBIrEPfhcrCD3fDnJ1asPXocJQ97CxI=; b=+Dk11t5dxqsV4xH3DcQn0eUXJ+m+asjEZZbUU4ZqwWJM+BSx7zTVyvSM6tqpdmJ4B3/bT9dHA 7HDB8bLUa5YC6LsjTPSQchwKFOUV0vBdmhzAMUF4d6GKG9iK1FKPWDZ X-Developer-Key: i=johannes.thumshirn@wdc.com; a=ed25519; pk=TGmHKs78FdPi+QhrViEvjKIGwReUGCfa+3LEnGoR2KM= Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Signed-off-by: Johannes Thumshirn --- fs/btrfs/print-tree.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/btrfs/print-tree.c b/fs/btrfs/print-tree.c index 2ade2672ed58..7e46aa8a0444 100644 --- a/fs/btrfs/print-tree.c +++ b/fs/btrfs/print-tree.c @@ -215,10 +215,9 @@ static void print_raid_stripe_key(const struct extent_buffer *eb, u32 item_size, btrfs_raid_array[encoding].raid_name : "unknown"); for (int i = 0; i < num_stripes; i++) - pr_info("\t\t\tstride %d devid %llu physical %llu length %llu\n", + pr_info("\t\t\tstride %d devid %llu physical %llu\n", i, btrfs_raid_stride_devid(eb, &stripe->strides[i]), - btrfs_raid_stride_physical(eb, &stripe->strides[i]), - btrfs_raid_stride_length(eb, &stripe->strides[i])); + btrfs_raid_stride_physical(eb, &stripe->strides[i])); } /* From patchwork Wed Oct 4 07:56:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 13408303 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B90CAE8FDD9 for ; Wed, 4 Oct 2023 07:56:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241644AbjJDH4g (ORCPT ); Wed, 4 Oct 2023 03:56:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232790AbjJDH4b (ORCPT ); Wed, 4 Oct 2023 03:56:31 -0400 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59E10A7; Wed, 4 Oct 2023 00:56:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1696406188; x=1727942188; h=from:date:subject:mime-version:content-transfer-encoding: message-id:references:in-reply-to:to:cc; bh=dfxEmiitU7sG/JHVT8Owzk/9e9RSoVO37pAJFjGfI8U=; b=fDU1qJh99wywnS1oE8VmnXI8zLvC3TuRr3M89Ko41hokpojP//DBvowX q+4S9XbLxySboYB54uryrKhHK6Rpy0KrtzgHCfGMbAbMk3v3VY2bZeITd aAv7DRCwjPEshv1NDIgFt56OWWUSyEEe5SSed6tZ+DToc6/Cr2QR4sO7T Osqxl3qIHOsGLKeRx3YyRERq0ZI4Qz3/o87J0d9gO87+uP4C7+Bsv8HRQ 67rW0rO6qB90jOiBaUzFacalh4cheSvGvsv/koID3Ic3l4HXjhn25Yslu sa76YHeegHMGMTQVlyWE/EP/Hsqave3pgjdkkTbDTfuUIcdkE+XFMKr0+ Q==; X-CSE-ConnectionGUID: SONxoOqNTSiNChR+QWqYmw== X-CSE-MsgGUID: CsyGpB5VQryE5hgB4ycYKA== X-IronPort-AV: E=Sophos;i="6.03,199,1694707200"; d="scan'208";a="351024176" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 04 Oct 2023 15:56:27 +0800 IronPort-SDR: KJYwXBMtsvDy2SLJtp0BEncQKjTzJfMK1Xz9fYmsUcivFm9YnykudaecVRnkd8Vm6cd0PU4FLV KLv01gZDf17otO6VTOwB7cYUN+5AZ/u4eCi3eJFKt/aMedWg1qEHUp35AwG1y1eRNQJBlXf9qp xSJKfS6rghsIXoCMyIqGgzhTOgKVWAwxZOSZrsv1BH4inJSzB8CMSLEDA+oGSPpqRVz4ZDwDth D//GNVgFa2Q7xQqQvuRn+fTSfszHIwR481Hwywsg0ZhkbTgE2pk9CY5ogK9KxsxGSbIva0M7Hv JEg= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 04 Oct 2023 00:03:06 -0700 IronPort-SDR: 88I+pvM7gpFB+3mWbzpar/sEOU2uc5ulMuQCzqyPrRtyCzCxsojQtmbRKuWHM3zxjamBZXcdpt a33m9yWOOdhBCOBACh8DYRtDwAH3NMK+O97rUQqn4BfYUZsxmm5QFJeQgB1BY8l5L7+cPyZ0NC Sc3nqrWLJw6x+yKLPjOHTF7bgouZHClg4n7GEe7EgSANWJPQksKkeSJOfxLgnJC1z8J9jS7FXN PoVAn5LCv2QDGJw7oK2MJuXMwsHPJwE3NxSYVwHTTHzR5U0zjQM+Tu3Z6Ma1VVK/iVTK42pyvE eZc= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.6]) by uls-op-cesaip01.wdc.com with ESMTP; 04 Oct 2023 00:56:27 -0700 From: Johannes Thumshirn Date: Wed, 04 Oct 2023 00:56:19 -0700 Subject: [PATCH v3 4/4] btrfs: remove stride length from on-disk format MIME-Version: 1.0 Message-Id: <20231004-rst-updates-v3-4-7729c4474ade@wdc.com> References: <20231004-rst-updates-v3-0-7729c4474ade@wdc.com> In-Reply-To: <20231004-rst-updates-v3-0-7729c4474ade@wdc.com> To: Chris Mason , Josef Bacik , David Sterba Cc: Qu Wenru , Damien Le Moal , Naohiro Aota , 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=1696406180; l=1791; i=johannes.thumshirn@wdc.com; s=20230613; h=from:subject:message-id; bh=dfxEmiitU7sG/JHVT8Owzk/9e9RSoVO37pAJFjGfI8U=; b=s6VAEOI6hGci33EzTXGqgS6KT3PosuQjrI0B71UqwFPeITDPjpcu89WQNJjMWdbvYyu3BQoAc EeB+Sie1ELjAaA+sDBZ9QPjAt7yrcs0v/B6yW9hXGGQgV9+CLW7n5NT X-Developer-Key: i=johannes.thumshirn@wdc.com; a=ed25519; pk=TGmHKs78FdPi+QhrViEvjKIGwReUGCfa+3LEnGoR2KM= Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Signed-off-by: Johannes Thumshirn --- fs/btrfs/accessors.h | 2 -- include/uapi/linux/btrfs_tree.h | 2 -- 2 files changed, 4 deletions(-) diff --git a/fs/btrfs/accessors.h b/fs/btrfs/accessors.h index b780d9087490..aa0844535644 100644 --- a/fs/btrfs/accessors.h +++ b/fs/btrfs/accessors.h @@ -309,12 +309,10 @@ BTRFS_SETGET_STACK_FUNCS(stack_timespec_nsec, struct btrfs_timespec, nsec, 32); BTRFS_SETGET_FUNCS(stripe_extent_encoding, struct btrfs_stripe_extent, encoding, 8); BTRFS_SETGET_FUNCS(raid_stride_devid, struct btrfs_raid_stride, devid, 64); BTRFS_SETGET_FUNCS(raid_stride_physical, struct btrfs_raid_stride, physical, 64); -BTRFS_SETGET_FUNCS(raid_stride_length, struct btrfs_raid_stride, length, 64); BTRFS_SETGET_STACK_FUNCS(stack_stripe_extent_encoding, struct btrfs_stripe_extent, encoding, 8); BTRFS_SETGET_STACK_FUNCS(stack_raid_stride_devid, struct btrfs_raid_stride, devid, 64); BTRFS_SETGET_STACK_FUNCS(stack_raid_stride_physical, struct btrfs_raid_stride, physical, 64); -BTRFS_SETGET_STACK_FUNCS(stack_raid_stride_length, struct btrfs_raid_stride, length, 64); /* struct btrfs_dev_extent */ BTRFS_SETGET_FUNCS(dev_extent_chunk_tree, struct btrfs_dev_extent, chunk_tree, 64); diff --git a/include/uapi/linux/btrfs_tree.h b/include/uapi/linux/btrfs_tree.h index 9fafcaebf44d..c25fc9614594 100644 --- a/include/uapi/linux/btrfs_tree.h +++ b/include/uapi/linux/btrfs_tree.h @@ -737,8 +737,6 @@ struct btrfs_raid_stride { __le64 devid; /* The physical location on disk. */ __le64 physical; - /* The length of stride on this disk. */ - __le64 length; } __attribute__ ((__packed__)); /* The stripe_extent::encoding, 1:1 mapping of enum btrfs_raid_types. */