From patchwork Wed May 18 09:17:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 12853408 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 4F680C433EF for ; Wed, 18 May 2022 09:17:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233974AbiERJR0 (ORCPT ); Wed, 18 May 2022 05:17:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233953AbiERJRV (ORCPT ); Wed, 18 May 2022 05:17:21 -0400 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98E8B19F85 for ; Wed, 18 May 2022 02:17:20 -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=1652865440; x=1684401440; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Te0pR3/quGq/f/Wi8zoD6c9aeM5Y2/WeW3aOOyc6lNk=; b=fIle5B5m6UxwlrUQ2xqOeNoJtzAYownsQCyBCrKHE4K/0mg7iMFYdy7P Y2TzOsp1H4zaLrAT6oS5T7FLUUgrQnGmKoKgbFMz4rQo+7ZxR+ya/M3X9 wkwkq4GC/kBysKu8/saZ/zUo6jgTYMzWijY+miNhE0I6/RI6k4LLEs2LQ wpiUEmmcPsBCzr+MeHJ+9Lki0hax42scgnYP538K1Ugk5mAXcG2D1BQob n5OxenBfL/uwF66ge7aOKIahtqTJ/qac/cn9rwEf/Xcvr2pmo8iDTSnV4 OvgnMNEul5y87J9r4mMqVAJHIrXnOwwpUa4h6bnf5VjdMSqyI3y+sBmBK Q==; X-IronPort-AV: E=Sophos;i="5.91,234,1647273600"; d="scan'208";a="201514743" 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; 18 May 2022 17:17:19 +0800 IronPort-SDR: H4gAm5Ke4Ipa9VHgl8XyiI2qpYW76dnEAUu8iqzSPrIQKRrc/QZaKhfSFIUJA4N5sVj3f8r7hJ /bdImn3ihMO01M6N8OMtA/MbrUffqAJ9urfaF/CjYdEtpDsC6FnFxvARnREzdRa67p8OWN97cy rBRK2EZSJ+546eOAoU5CD1UC/8L0ZZQfoUP4zT0wAYrprEj/oXBK5659CoSY0zzkYuveE3k9w+ Vku4bp96x2GkTVRgsbvA9TJENlUXVPq5nVg781M01j+DkM4C5UTopXqvXCUs1jfafiS5EE0WPM B+nqAHxLm7B9/0HwEGLPn1Cz 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; 18 May 2022 01:40:22 -0700 IronPort-SDR: OzdXNEYu8N+MOLkjCcfbHiQLFqEZcAXhvMJ7O8bnOmInWOj/S/+xBPipyHYSAmHVEPX14tvetW GCC9diaqfFDsXAZveljTNwVNySXsNxkNrYD/XNNHYdpUV5N2EFlK9lFJC6WeEFty9rUu37dKO9 GatX5xBgO6XrKYtDRWRjhdHe1CFJ3ywTLH6tlYExQV6kDT2g8BJoSq3FYU0rneUwZfNNXkG1jp +f/HgoU1lfWeJPldri8ZEF62hA4oqU+vYTX+Zjy4YeMYN8cfEX2o9tY0MqW8csyGeNoHdI/sKz H/E= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip02.wdc.com with ESMTP; 18 May 2022 02:17:18 -0700 From: Johannes Thumshirn To: linux-btrfs@vger.kernel.org Cc: Johannes Thumshirn Subject: [RFC ONLY 1/6] btrfs-progs: add raid-stripe-tree definitions Date: Wed, 18 May 2022 02:17:11 -0700 Message-Id: <20220518091716.786452-2-johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220518091716.786452-1-johannes.thumshirn@wdc.com> References: <20220518091716.786452-1-johannes.thumshirn@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Signed-off-by: Johannes Thumshirn --- kernel-shared/ctree.h | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h index 68943ff294cc..56b3185001af 100644 --- a/kernel-shared/ctree.h +++ b/kernel-shared/ctree.h @@ -300,6 +300,24 @@ struct btrfs_chunk { /* additional stripes go here */ } __attribute__ ((__packed__)); +struct btrfs_stripe_extent { + /* btrfs device-id this raid extent lives on */ + __le64 devid; + /* offset from the devextent start */ + __le64 offset; +} __attribute__ ((__packed__)); + +struct btrfs_dp_stripe { + /* logical address for this stripe */ + __le64 logical; + /* size of this stripe in bytes */ + __le32 size; + /* reserved for future use/padding */ + __le32 reserved; + /* array of stripe extents this stripe is comprised of */ + struct btrfs_stripe_extent extents; +} __attribute__ ((__packed__)); + #define BTRFS_FREE_SPACE_EXTENT 1 #define BTRFS_FREE_SPACE_BITMAP 2 @@ -1206,6 +1224,7 @@ struct btrfs_fs_info { struct btrfs_root *quota_root; struct btrfs_root *uuid_root; struct btrfs_root *block_group_root; + struct btrfs_root *stripe_root; struct rb_root global_roots_tree; struct rb_root fs_root_tree; @@ -1749,6 +1768,36 @@ BTRFS_SETGET_FUNCS(free_space_extent_count, struct btrfs_free_space_info, extent_count, 32); BTRFS_SETGET_FUNCS(free_space_flags, struct btrfs_free_space_info, flags, 32); +/* struct btrfs_dp_stripe */ +BTRFS_SETGET_FUNCS(dp_stripe_logical, struct btrfs_dp_stripe, logical, 64); +BTRFS_SETGET_FUNCS(dp_stripe_size, struct btrfs_dp_stripe, size, 32); +BTRFS_SETGET_FUNCS(stripe_extent_devid, struct btrfs_stripe_extent, devid, 64); +BTRFS_SETGET_FUNCS(stripe_extent_offset, struct btrfs_stripe_extent, offset, 64); + +static inline struct btrfs_stripe_extent *btrfs_stripe_extent_nr( + struct btrfs_dp_stripe *dps, + int nr) +{ + unsigned long offset = (unsigned long)dps; + offset += offsetof(struct btrfs_dp_stripe, extents); + offset += nr * sizeof(struct btrfs_stripe_extent); + return (struct btrfs_stripe_extent *)offset; +} + +static inline u64 btrfs_stripe_extent_devid_nr(struct extent_buffer *eb, + struct btrfs_dp_stripe *dps, + int nr) +{ + return btrfs_stripe_extent_devid(eb, btrfs_stripe_extent_nr(dps, nr)); +} + +static inline u64 btrfs_stripe_extent_offset_nr(struct extent_buffer *eb, + struct btrfs_dp_stripe *dps, + int nr) +{ + return btrfs_stripe_extent_offset(eb, btrfs_stripe_extent_nr(dps, nr)); +} + /* struct btrfs_inode_ref */ BTRFS_SETGET_FUNCS(inode_ref_name_len, struct btrfs_inode_ref, name_len, 16); BTRFS_SETGET_STACK_FUNCS(stack_inode_ref_name_len, struct btrfs_inode_ref, name_len, 16); From patchwork Wed May 18 09:17:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 12853388 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 8D954C433FE for ; Wed, 18 May 2022 09:17:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233888AbiERJRY (ORCPT ); Wed, 18 May 2022 05:17:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233954AbiERJRW (ORCPT ); Wed, 18 May 2022 05:17:22 -0400 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3208F1A060 for ; Wed, 18 May 2022 02:17:21 -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=1652865441; x=1684401441; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=b3kGikADO8HuoOwaiLohILbi67iOF1BbMB4LojY3yqk=; b=M/NMxYnuH2b0b5IbyTvhVIXd6SdTwBRoQ6xFAw5GPC4rZRR9R2Mdq/7x USnanAD7DBwqqDPY8OEOUKfr4/sIeOX9k6qC650xGg60lZQfdHVHTWfg5 n09gWDeQsnbC02a9XDbuMaYNb5dBNMUqYaCI1GO11J600aIeBJTns8SBr saSjrX893s2ARrICKFN5bqelfyazYl0ARgzC1TiD7aBti0oZNPEdSjod1 N5ljvl+5GICtOBmUkASzgEeoJG2R5xXJVoIovrYs5lm8DrJFr+FH9ZC9p cJWWOTim6jtpUpR8S3ZJ4IqE2ITcbQ/3yqQt4qcakqf14fiEpugTX+seI g==; X-IronPort-AV: E=Sophos;i="5.91,234,1647273600"; d="scan'208";a="201514744" 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; 18 May 2022 17:17:20 +0800 IronPort-SDR: oJGNuz8wYreIvJEGvwSk17kcud9N0R9zj43/qrxcvQQgIFUHqoohWzWgz0C1MeEPsSvM9wHq1y f+YlrgeeZj/sIFqszqOAGaYX5TksJkFEjJHgIXNCQd2ag+TVjcbdMZTyKY/i/zX+xPo2S45q35 TvNpQC8/qpOLIm5huybqCSky0dtkxJzp6IHbO18N1b7y0hnbI8ZxAaeIk73kK9cneV5BYyEUM4 HOAViXXTqZf39KSmPEdHZT1wvwINAeAVdH3PkrasBta+kjFrcYNkBTuDOZqllBxIYHuN/tvoEQ HkMLZy3kudLv/bNAweGGbWhk 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; 18 May 2022 01:40:23 -0700 IronPort-SDR: B7cYCIi9WZ0DcD3SEwGsAbuSQASARnhQtLO8lQbgsmJn6S2joIXc/OwYJsQSgDmePX2usHQzDM UHrRhLPapiYAYH/7SLJvrz2yjfX0bKq/Xx5jVDb4o19DlFm7kwzo3oJOBJcTA3odT8Lo/OGZNP 3XSysLNWxbUR7xEuC9CPpS65UsKf42bOBRDHBBbaS+fYaiU/ubEyPzMHKIN5CdYBVim8LKpu4V 0PckNYHcgA6gTpC3zmh6qRC0GP37AFnNXEgYT6Fdap4rVxS97Lpjhj5/3GbloeUd5nZouenm9x xpE= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip02.wdc.com with ESMTP; 18 May 2022 02:17:19 -0700 From: Johannes Thumshirn To: linux-btrfs@vger.kernel.org Cc: Johannes Thumshirn Subject: [RFC ONLY 2/6] btrfs-progs: read fs with stripe tree from disk Date: Wed, 18 May 2022 02:17:12 -0700 Message-Id: <20220518091716.786452-3-johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220518091716.786452-1-johannes.thumshirn@wdc.com> References: <20220518091716.786452-1-johannes.thumshirn@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Signed-off-by: Johannes Thumshirn --- kernel-shared/disk-io.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/kernel-shared/disk-io.c b/kernel-shared/disk-io.c index d70130ac121e..7109d434a2f4 100644 --- a/kernel-shared/disk-io.c +++ b/kernel-shared/disk-io.c @@ -881,6 +881,10 @@ struct btrfs_root *btrfs_read_fs_root(struct btrfs_fs_info *fs_info, return fs_info->block_group_root ? fs_info->block_group_root : ERR_PTR(-ENOENT); + if (location->objectid == BTRFS_RAID_STRIPE_TREE_OBJECTID) + return fs_info->stripe_root ? fs_info->stripe_root : + ERR_PTR(-ENOENT); + BUG_ON(location->objectid == BTRFS_TREE_RELOC_OBJECTID); node = rb_search(&fs_info->fs_root_tree, (void *)&objectid, @@ -913,6 +917,9 @@ void btrfs_free_fs_info(struct btrfs_fs_info *fs_info) if (fs_info->quota_root) free(fs_info->quota_root); + if (fs_info->stripe_root) + free(fs_info->stripe_root); + free_global_roots_tree(&fs_info->global_roots_tree); free(fs_info->tree_root); free(fs_info->chunk_root); @@ -937,12 +944,14 @@ struct btrfs_fs_info *btrfs_new_fs_info(int writable, u64 sb_bytenr) fs_info->dev_root = calloc(1, sizeof(struct btrfs_root)); fs_info->quota_root = calloc(1, sizeof(struct btrfs_root)); fs_info->uuid_root = calloc(1, sizeof(struct btrfs_root)); + fs_info->stripe_root = calloc(1, sizeof(struct btrfs_root)); fs_info->block_group_root = calloc(1, sizeof(struct btrfs_root)); fs_info->super_copy = calloc(1, BTRFS_SUPER_INFO_SIZE); if (!fs_info->tree_root || !fs_info->chunk_root || !fs_info->dev_root || !fs_info->quota_root || !fs_info->uuid_root || - !fs_info->block_group_root || !fs_info->super_copy) + !fs_info->block_group_root || !fs_info->super_copy || + !fs_info->stripe_root) goto free_all; extent_io_tree_init(&fs_info->extent_cache); @@ -1364,6 +1373,15 @@ int btrfs_setup_all_roots(struct btrfs_fs_info *fs_info, u64 root_tree_bytenr, return -EIO; } + ret = find_and_setup_root(root, fs_info, BTRFS_RAID_STRIPE_TREE_OBJECTID, + fs_info->stripe_root); + if (ret) { + free(fs_info->stripe_root); + fs_info->stripe_root = NULL; + } else { + fs_info->stripe_root->track_dirty = 1; + } + if (!btrfs_fs_incompat(fs_info, EXTENT_TREE_V2) && maybe_load_block_groups(fs_info, flags)) { ret = btrfs_read_block_groups(fs_info); @@ -1422,6 +1440,8 @@ void btrfs_release_all_roots(struct btrfs_fs_info *fs_info) free_extent_buffer(fs_info->chunk_root->node); if (fs_info->uuid_root) free_extent_buffer(fs_info->uuid_root->node); + if (fs_info->stripe_root) + free_extent_buffer(fs_info->stripe_root->node); } static void free_map_lookup(struct cache_extent *ce) From patchwork Wed May 18 09:17:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 12853390 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 C59A2C433F5 for ; Wed, 18 May 2022 09:17:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233992AbiERJRa (ORCPT ); Wed, 18 May 2022 05:17:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233938AbiERJRX (ORCPT ); Wed, 18 May 2022 05:17:23 -0400 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0C941CFCC for ; Wed, 18 May 2022 02:17:21 -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=1652865442; x=1684401442; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ezC6m7jJf2tUpJVCviGpUIIm3wuctBs8UxcDDBa277g=; b=o7kg2b/+8xN9eOYmfuY1mbYKoEyWEpd07ZNZIgYE1SKfWcTgBf0aHfdO Dxv8XR1nl10apM09KfycEMF6RPFE472OGLmYQpVAgWOO7k9KY9Po17qpY nabmv/GX2QsajC995q+FHCVWZWy2NwvBBGXPqVcEov0yTLFvZccwC1ZmK 42lRIhPMTEkAw1IYvsf0WFUJoWFdP1OEpvpJ0TtWU1tov/6WYLE0w8rxl It0LkPKc32pCneyPogUooMynRsGXv7POq0gLeFXJ/EEZqYtydMvrt3xPZ uNi0ii9qk5GaZnfvzjq3zNyLjVOrcQ2rgddX3zPe2NhVMBdhzYfDnQNju Q==; X-IronPort-AV: E=Sophos;i="5.91,234,1647273600"; d="scan'208";a="201514745" 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; 18 May 2022 17:17:21 +0800 IronPort-SDR: nGJs3OAsH4y4rGKFJvCNL66U/5jNBm//XXQ2Pe0zszw1W9GedVChA6O2yI6F4CG1U8h8QPpsXI flcrUh1gucWVnyss5S/bMSGEisPwbOVE8Zv9lQP1sPYDclqVDZfh9S1ofFafP5wKsgnSECv9Ho ovKazsFc6+/gYG/gEe2zUPHGGYXXcvf9l8DuJR8SeUkBBKKiQStgz9TDsPiM9lz6fWIB0nWIV8 I/XMweoZANz8bL7agb9RyL37mXeEaAd9/NHqstxZ0ZxZrcq9P4fwOnkAq6PWLcqblxI4EOpip+ 5Iq/b2+fvGU32VTeqgHfdN0P 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; 18 May 2022 01:40:23 -0700 IronPort-SDR: g1pQox/b3egXTw6PqVZGbdmkZVKWxm9073Sl0B6kouTHSrOSX8TmLDl25B1dCE282svrnudLkc uJE/fdSMFDlReqth8lotElv5KLsmNS4mz8y2mNphCVXdZGKjafyun0zPt6qZKAxUQBjRxxDj3A Lab21LTvYpup6vwVzpsP32ZTxqffwUh2RyYHw/JDBOfDRINwiO/DHAQIu+CHyKrxnZZPT9fPh+ S3DP7agNmdsxmRq8TvXO3a4USNTVRaLFTZWunOpiCC9DdeIiGRC0ZKzeuU+W69TZglFvq0EYSC oOI= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip02.wdc.com with ESMTP; 18 May 2022 02:17:20 -0700 From: Johannes Thumshirn To: linux-btrfs@vger.kernel.org Cc: Johannes Thumshirn Subject: [RFC ONLY 3/6] btrfs-progs: add dump tree support for the raid stripe tree Date: Wed, 18 May 2022 02:17:13 -0700 Message-Id: <20220518091716.786452-4-johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220518091716.786452-1-johannes.thumshirn@wdc.com> References: <20220518091716.786452-1-johannes.thumshirn@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Signed-off-by: Johannes Thumshirn --- cmds/inspect-dump-tree.c | 5 +++++ kernel-shared/ctree.h | 3 +++ kernel-shared/print-tree.c | 27 +++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/cmds/inspect-dump-tree.c b/cmds/inspect-dump-tree.c index daa7f9255139..999047ea0c28 100644 --- a/cmds/inspect-dump-tree.c +++ b/cmds/inspect-dump-tree.c @@ -163,6 +163,7 @@ static u64 treeid_from_string(const char *str, const char **end) { "TREE_RELOC", BTRFS_TREE_RELOC_OBJECTID }, { "DATA_RELOC", BTRFS_DATA_RELOC_TREE_OBJECTID }, { "BLOCK_GROUP_TREE", BTRFS_BLOCK_GROUP_TREE_OBJECTID }, + { "RAID_STRIPE", BTRFS_RAID_STRIPE_TREE_OBJECTID }, }; if (strncasecmp("BTRFS_", str, strlen("BTRFS_")) == 0) @@ -728,6 +729,10 @@ again: if (!skip) printf("block group"); break; + case BTRFS_RAID_STRIPE_TREE_OBJECTID: + if (!skip) + printf("raid stripe"); + break; default: if (!skip) { printf("file"); diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h index 56b3185001af..40e5e09897b1 100644 --- a/kernel-shared/ctree.h +++ b/kernel-shared/ctree.h @@ -1493,6 +1493,9 @@ static inline u32 BTRFS_MAX_XATTR_SIZE(const struct btrfs_fs_info *info) #define BTRFS_QGROUP_LIMIT_KEY 244 #define BTRFS_QGROUP_RELATION_KEY 246 + +#define BTRFS_RAID_STRIPE_KEY 247 + /* * Obsolete name, see BTRFS_TEMPORARY_ITEM_KEY. */ diff --git a/kernel-shared/print-tree.c b/kernel-shared/print-tree.c index 9c12dfcb4ca5..d1b51065c2f3 100644 --- a/kernel-shared/print-tree.c +++ b/kernel-shared/print-tree.c @@ -635,6 +635,26 @@ static void print_free_space_header(struct extent_buffer *leaf, int slot) (unsigned long long)btrfs_free_space_bitmaps(leaf, header)); } +static void print_raid_stripe_key(struct extent_buffer *eb, + u32 item_size, + struct btrfs_dp_stripe *stripe) +{ + int num_stripes; + int i; + + num_stripes = (item_size - offsetof(struct btrfs_dp_stripe, extents)) / + sizeof(struct btrfs_stripe_extent); + + printf("\t\tlogical %llu, size: %llu\n", + (unsigned long long)btrfs_dp_stripe_logical(eb, stripe), + (unsigned long long)btrfs_dp_stripe_size(eb, stripe)); + + for (i = 0; i < num_stripes; i++) + printf("\t\t\tstripe %d devid %llu offset %llu\n", i, + (unsigned long long)btrfs_stripe_extent_devid_nr(eb, stripe, i), + (unsigned long long)btrfs_stripe_extent_offset_nr(eb, stripe, i)); +} + void print_key_type(FILE *stream, u64 objectid, u8 type) { static const char* key_to_str[256] = { @@ -679,6 +699,7 @@ void print_key_type(FILE *stream, u64 objectid, u8 type) [BTRFS_PERSISTENT_ITEM_KEY] = "PERSISTENT_ITEM", [BTRFS_UUID_KEY_SUBVOL] = "UUID_KEY_SUBVOL", [BTRFS_UUID_KEY_RECEIVED_SUBVOL] = "UUID_KEY_RECEIVED_SUBVOL", + [BTRFS_RAID_STRIPE_KEY] = "RAID_STRIPE_KEY", }; if (type == 0 && objectid == BTRFS_FREE_SPACE_OBJECTID) { @@ -788,6 +809,9 @@ void print_objectid(FILE *stream, u64 objectid, u8 type) case BTRFS_BLOCK_GROUP_TREE_OBJECTID: fprintf(stream, "BLOCK_GROUP_TREE"); break; + case BTRFS_RAID_STRIPE_TREE_OBJECTID: + fprintf(stream, "RAID_STRIPE_TREE"); + break; case (u64)-1: fprintf(stream, "-1"); break; @@ -1453,6 +1477,9 @@ void btrfs_print_leaf(struct extent_buffer *eb, unsigned int mode) case BTRFS_TEMPORARY_ITEM_KEY: print_temporary_item(eb, ptr, objectid, offset); break; + case BTRFS_RAID_STRIPE_KEY: + print_raid_stripe_key(eb, item_size, ptr); + break; }; fflush(stdout); } From patchwork Wed May 18 09:17:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 12853407 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 5FAF9C433F5 for ; Wed, 18 May 2022 09:17:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233982AbiERJR3 (ORCPT ); Wed, 18 May 2022 05:17:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233955AbiERJRX (ORCPT ); Wed, 18 May 2022 05:17:23 -0400 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FCF21CFF7 for ; Wed, 18 May 2022 02:17:22 -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=1652865442; x=1684401442; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=eic1LlmqxIbArYc8QtA8cTpQ9RBcvw/rCcmaEUkC+6U=; b=mEWTm5m9py/NnYup94xqAnPSrV+vkNjojNQQMLT9rD41Ls5FBjE/FC0G rx32eKi4ExA34d5Usx9plXdwO0/4PwecftddsvsFibBZFyFkkq6fHXNlM XVLXXyXbB+J9hw52B+2S612fCovhN+BhiOPIdXMuu9+1C+gEEn80mLgSh fNH5OAeHWhUeE5NX3O5/ystBw0LCkQ9SNablRpaypOvZ59S7ZiHl0wBld Koqfhsjj4v8lEpwri7HgNWs9ffUxNGFVF5EtEFjUMgIvaO4tKbE5Y3cbY 2ZGBtQ54cgWKJSudE0opIX/CTWHLmhO4TsnFaTiWm9Jbt3UKZlFQcrxom w==; X-IronPort-AV: E=Sophos;i="5.91,234,1647273600"; d="scan'208";a="201514748" 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; 18 May 2022 17:17:21 +0800 IronPort-SDR: umq04vpoRgwO65U459Z1QnJw7MA1+qFS4jUgqsi8jGHpj7/JRpUkQfhky9lR120f9x3/6ii2zw Og9j9vLSviuL/OVzLACGlYXFsXzLpcNHpHCY29ZbB85A/dwmGuD8dYin+AT108I0f7v1Qg2HX7 KEs62QonDpef5HcL5X3ZDCKdPSPNC1F5BkVxR886srXpIzr52qVwg2iNAYsc0ysQZLIVtgj5+S 3o9zDhmwYDEmDTsBQX91TmbyBzx+GP39rlT1iqzsPZM4kP3uExj1TIUqXqBZQCQzqH//QE8NnA nk4Li9UIk9ZJQlo5ogeR1/6l 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; 18 May 2022 01:40:24 -0700 IronPort-SDR: C4G0NsdmP0zxw/m3uNoPV/lqzYIMUMeEMpj/fTb0qZky0B2LOfJ+eZ94DzxAhS9GCf1GKTOF6d 3R9vjJn5vkZan8HUDpQlzIAhcrV18kBNdc8iZmgEbhjJCQ3+4CrruD7anqdABQFlSddtklLd6a 7ujk8KXG9QIlMtcXxTD33HPcqxD4FyWh1rw0uK2z7efyIdUmMVtJc+pIsKO352bRvtuF+aRo8U tAsQfn2YkCEmGGb4ZXTrcs9SEdbxIgivWmPt4reFfdvIK0Lj3DjEeF5IM1cEHaGws3Q92U25GE qFM= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip02.wdc.com with ESMTP; 18 May 2022 02:17:20 -0700 From: Johannes Thumshirn To: linux-btrfs@vger.kernel.org Cc: Johannes Thumshirn Subject: [RFC ONLY 4/6] btrfs-progs: allow zoned RAID1 Date: Wed, 18 May 2022 02:17:14 -0700 Message-Id: <20220518091716.786452-5-johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220518091716.786452-1-johannes.thumshirn@wdc.com> References: <20220518091716.786452-1-johannes.thumshirn@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Signed-off-by: Johannes Thumshirn --- kernel-shared/zoned.c | 20 +++++++++++++++----- kernel-shared/zoned.h | 4 ++-- mkfs/main.c | 4 ++-- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/kernel-shared/zoned.c b/kernel-shared/zoned.c index 396b74f0d906..7d6f4357ea9a 100644 --- a/kernel-shared/zoned.c +++ b/kernel-shared/zoned.c @@ -775,7 +775,7 @@ out: return ret; } -bool zoned_profile_supported(u64 map_type) +bool zoned_profile_supported(u64 map_type, bool rst) { bool data = (map_type & BTRFS_BLOCK_GROUP_DATA); u64 flags = (map_type & BTRFS_BLOCK_GROUP_PROFILE_MASK); @@ -784,9 +784,18 @@ bool zoned_profile_supported(u64 map_type) if (flags == 0) return true; - /* We can support DUP on metadata */ - if (!data && (flags & BTRFS_BLOCK_GROUP_DUP)) - return true; + if (data) { + /* Data RAID1 needs a raid-stripe-tree */ + if ((flags & BTRFS_BLOCK_GROUP_RAID1_MASK) && rst) + return true; + } else { + /* We can support DUP on metadata/system */ + if (flags & BTRFS_BLOCK_GROUP_DUP) + return true; + /* We can support RAID1 on metadata/system */ + if (flags & BTRFS_BLOCK_GROUP_RAID1_MASK) + return true; + } /* All other profiles are not supported yet */ return false; @@ -903,7 +912,8 @@ int btrfs_load_block_group_zone_info(struct btrfs_fs_info *fs_info, } } - if (!zoned_profile_supported(map->type)) { + // XXX: not sure how to do yet + if (!zoned_profile_supported(map->type, true)) { error("zoned: profile %s not yet supported", btrfs_group_profile_str(map->type)); ret = -EINVAL; diff --git a/kernel-shared/zoned.h b/kernel-shared/zoned.h index cc0d6b6f166d..c56788bcf07b 100644 --- a/kernel-shared/zoned.h +++ b/kernel-shared/zoned.h @@ -132,7 +132,7 @@ static inline bool btrfs_dev_is_empty_zone(struct btrfs_device *device, u64 pos) return zinfo->zones[zno].cond == BLK_ZONE_COND_EMPTY; } -bool zoned_profile_supported(u64 map_type); +bool zoned_profile_supported(u64 map_type, bool rst); int btrfs_reset_dev_zone(int fd, struct blk_zone *zone); u64 btrfs_find_allocatable_zones(struct btrfs_device *device, u64 hole_start, u64 hole_end, u64 num_bytes); @@ -213,7 +213,7 @@ static inline int btrfs_wipe_temporary_sb(struct btrfs_fs_devices *fs_devices) return 0; } -static inline bool zoned_profile_supported(u64 map_type) +static inline bool zoned_profile_supported(u64 map_type, bool rst) { return false; } diff --git a/mkfs/main.c b/mkfs/main.c index a603ec5896f3..46dbc4c0c363 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -1424,8 +1424,8 @@ int BOX_MAIN(mkfs)(int argc, char **argv) if (ret) goto error; - if (zoned && (!zoned_profile_supported(BTRFS_BLOCK_GROUP_METADATA | metadata_profile) || - !zoned_profile_supported(BTRFS_BLOCK_GROUP_DATA | data_profile))) { + if (zoned && (!zoned_profile_supported(BTRFS_BLOCK_GROUP_METADATA | metadata_profile, runtime_features & BTRFS_RUNTIME_FEATURE_RAID_STRIPE_TREE) || + !zoned_profile_supported(BTRFS_BLOCK_GROUP_DATA | data_profile, runtime_features & BTRFS_RUNTIME_FEATURE_RAID_STRIPE_TREE))) { error("zoned mode does not yet support RAID/DUP profiles, please specify '-d single -m single' manually"); goto error; } From patchwork Wed May 18 09:17:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 12853391 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 BFEF7C433FE for ; Wed, 18 May 2022 09:17:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233948AbiERJRd (ORCPT ); Wed, 18 May 2022 05:17:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233963AbiERJRZ (ORCPT ); Wed, 18 May 2022 05:17:25 -0400 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45AF219C3D for ; Wed, 18 May 2022 02:17: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=1652865443; x=1684401443; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=cwtEpad7clfcSJikOAaEnqnVTV2opFqaeGWePtafWlg=; b=m6eGwI+n6TnQFJ5lUCCLQS6K2bjtHw7xKoRqSG1keHIq4e65rbVl2YfB lx+PiVswC9HfCKdamQc0sDbAgqQHSrObx+5IHFgZusaHwNnTqPrUlkciT QtPe/qIrHCF4rGcV5BRHefEdGQmsFvVZOZ0Kp14wNbFBEc45j6I83gh0U 1lYEg7UXVoI02ZrwTDdFHZuY2Bo76INBf01VqtiOuY2qR+fZRbnwvhSyL sqyNZUZe5/74w+dEKyep0/Zm5Yh4yJffMkdDRr4KShfiJQrO0N5Y81+Qo 4vnxhCdNeFQzX3vDvahPM/AFht55r7w7oU7pCh7zlpR+qtSTXxVLuTiNG A==; X-IronPort-AV: E=Sophos;i="5.91,234,1647273600"; d="scan'208";a="201514750" 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; 18 May 2022 17:17:22 +0800 IronPort-SDR: 2suzW6XIdhD2frPIRvcjN/gK2QmtmSEjKtstLBFtpJ8j4pqx4gXdNQ77f+jjRJ5IzylVHrHH+D Fx9FrpjRPARfPCeVk3qH2xnY0sgXOUkS8FEj4yCFxkI1bt/akTvTu4bE5n7ODvzb9RS65ql/I+ XeTfv3yXBzARvPTLQ+nfZGpOgK0tFg7J0KShZsDLZ8R7bCIn689DP7sOZzES/PK2l64EkL/jjG JBWXXVlIEWDtwrBP5udYoN+OTgeL6eeZ6U2WsTBMlizdvcAhpzl3dPdiK54d7J7RS9jhRTDXnd /llPkTuTsR+Xw4lTJYUIDN/p 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; 18 May 2022 01:40:25 -0700 IronPort-SDR: 6Ih6JeLtS5SQb72YlX7vRK2UibMYNmbGQKVHuBSY0nsIUAYmLESBk7yzj9spWIvSKGiz8WIENE Tim/hMd47267piSFSPSm2UJYxb5k8lYUK//RpGbHy5dsL7EkUU5IMI0MopEGtG5pi3fLfyaYw2 JxaAL3AsZDJH1KbeLUm/adqZ9VOmmAGx+XdLyqIx4vMBYHOTQjfwqdRKoHXZDvW3QmKphoRko/ t4bstUVR2HRAtq8vwSsAxMzGIOtB358g1qI4XVY9B5nSDXPWGVUZH+V4FFSM9CBDvSkkIeFBQn hyc= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip02.wdc.com with ESMTP; 18 May 2022 02:17:21 -0700 From: Johannes Thumshirn To: linux-btrfs@vger.kernel.org Cc: Johannes Thumshirn Subject: [RFC ONLY 5/6] btrfs-progs: add raid-stripe-tree to mkfs runtime features Date: Wed, 18 May 2022 02:17:15 -0700 Message-Id: <20220518091716.786452-6-johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220518091716.786452-1-johannes.thumshirn@wdc.com> References: <20220518091716.786452-1-johannes.thumshirn@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Signed-off-by: Johannes Thumshirn --- common/fsfeatures.c | 8 ++++++++ common/fsfeatures.h | 1 + kernel-shared/ctree.h | 3 +++ mkfs/main.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+) diff --git a/common/fsfeatures.c b/common/fsfeatures.c index 23a92c21a2cc..ed34aadb4d7e 100644 --- a/common/fsfeatures.c +++ b/common/fsfeatures.c @@ -172,6 +172,14 @@ static const struct btrfs_feature runtime_features[] = { VERSION_TO_STRING2(safe, 4,9), VERSION_TO_STRING2(default, 5,15), .desc = "free space tree (space_cache=v2)" + } , { + .name = "raid-stripe-tree", + .flag = BTRFS_RUNTIME_FEATURE_RAID_STRIPE_TREE, + .sysfs_name = NULL, + VERSION_NULL(compat), + VERSION_NULL(safe), + VERSION_NULL(default), + .desc = "raid stripe tree" }, /* Keep this one last */ { diff --git a/common/fsfeatures.h b/common/fsfeatures.h index 9e39c667b900..8d9a925af6c4 100644 --- a/common/fsfeatures.h +++ b/common/fsfeatures.h @@ -45,6 +45,7 @@ #define BTRFS_RUNTIME_FEATURE_QUOTA (1ULL << 0) #define BTRFS_RUNTIME_FEATURE_FREE_SPACE_TREE (1ULL << 1) +#define BTRFS_RUNTIME_FEATURE_RAID_STRIPE_TREE (1ULL << 2) void btrfs_list_all_fs_features(u64 mask_disallowed); void btrfs_list_all_runtime_features(u64 mask_disallowed); diff --git a/kernel-shared/ctree.h b/kernel-shared/ctree.h index 40e5e09897b1..b2348c4303fd 100644 --- a/kernel-shared/ctree.h +++ b/kernel-shared/ctree.h @@ -88,6 +88,9 @@ struct btrfs_free_space_ctl; /* hold the block group items. */ #define BTRFS_BLOCK_GROUP_TREE_OBJECTID 11ULL +/* hold the raid-stripe entries */ +#define BTRFS_RAID_STRIPE_TREE_OBJECTID 12ULL + /* device stats in the device tree */ #define BTRFS_DEV_STATS_OBJECTID 0ULL diff --git a/mkfs/main.c b/mkfs/main.c index 46dbc4c0c363..881de53b11fe 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -969,6 +969,38 @@ fail: return ret; } +static int setup_raid_stripe_tree_root(struct btrfs_fs_info *fs_info) +{ + struct btrfs_trans_handle *trans; + struct btrfs_root *stripe_root; + struct btrfs_key key = { + .objectid = BTRFS_RAID_STRIPE_TREE_OBJECTID, + .type = BTRFS_ROOT_ITEM_KEY, + }; + int ret; + + trans = btrfs_start_transaction(fs_info->tree_root, 0); + if (IS_ERR(trans)) + return PTR_ERR(trans); + + stripe_root = btrfs_create_tree(trans, fs_info, &key); + if (IS_ERR(stripe_root)) { + ret = PTR_ERR(stripe_root); + goto abort; + } + fs_info->stripe_root = stripe_root; + add_root_to_dirty_list(stripe_root); + + ret = btrfs_commit_transaction(trans, fs_info->tree_root); + if (ret) + return ret; + + return 0; +abort: + btrfs_abort_transaction(trans, ret); + return ret; +} + int BOX_MAIN(mkfs)(int argc, char **argv) { char *file; @@ -1689,6 +1721,16 @@ raid_groups: goto out; } } + if (runtime_features & BTRFS_RUNTIME_FEATURE_RAID_STRIPE_TREE) { + ret = setup_raid_stripe_tree_root(fs_info); + if (ret < 0) { + error("failed to initialize raid-stripe-tree: %d (%m)", + ret); + goto out; + } + } + + if (bconf.verbose) { char features_buf[64]; From patchwork Wed May 18 09:17:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Thumshirn X-Patchwork-Id: 12853389 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 6A66BC433EF for ; Wed, 18 May 2022 09:17:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233938AbiERJRc (ORCPT ); Wed, 18 May 2022 05:17:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233964AbiERJRZ (ORCPT ); Wed, 18 May 2022 05:17:25 -0400 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A037C1A060 for ; Wed, 18 May 2022 02:17: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=1652865444; x=1684401444; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=KxQFsUJVGLomXi5JGfsV8Uj6ugKVdOX5yfiCfiBtgfQ=; b=fF9d7W8+lZCPukJF/dNgY9l2pDJhTJUeJrlZm9eeZvCdn9/Nao4j3olM CLmeHl9XISBeh+fLf7QrCbtT4Va7AENM4/kSXvcOXpvD5U4M/2ww0VAPK rMfiBAQbAhCDKgk4qwEhyPTRDmTwoE60VDMkr+BOxskXfMRgouOmIeoYq Ih6en4n85xwuimKaJM9opQht/25OcpqAQnBcUhPS6OPO5utNR3SjcdpT7 ANDE9M4PLMofeEFEJh2wAdaN+zv53NwFMqHzd/XOwkL0dXibTLgqrsJrE ZHrfqzYnqs0b0YRk562RohlQjfx7E0Dy99rl6V6XYa5H2s6TTVDqD35fH g==; X-IronPort-AV: E=Sophos;i="5.91,234,1647273600"; d="scan'208";a="201514751" 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; 18 May 2022 17:17:23 +0800 IronPort-SDR: URAzZu3+RbQzi0IvAsWz1QR/Xa7uXNLxPFro+TAEdVK5rQqV3u1RLxO3A3y0fRb1ETajv0kl4i qBoUbjKAxNT6HRuQd8Spb50c2vqKnA5Xof7VrAx0MGAZcADf+gvyhRyKQiIb4C+yMHuA3AELYh NiAZjE/fhVDwffPao312ARbvWEWfXsXR7A/J43q2p0VICuqJj0G3AeB3ZJ+r/7C8vWvSrUQuNe V51jSUyX13mwwPgLzu80pinGn2LG5BWCtrf/GO8P0oimi4gElB21Vz+IXMgSkrQ98LTLM8Zue1 ug/LC6eSAbdbIXvceYu75IDo 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; 18 May 2022 01:40:26 -0700 IronPort-SDR: 3FUHEx3PxsT9/vErL0uOZRpF3UZIXid/BNvrwfTrpFyZ9sr0+XJ0O/p1Eo+1lBC7Miv6sTXavp GbZ2cAUoiD6bLat5nbEWNJ/paHNmQwtLzGyW6LSiPUMxS5jk4f/iWYRqPmVs8PcXvzXoFjuvCR /8FQk68fT0rcNUjZhkT76riSpNguXJyi6OJh0TV+hhhyKkFmr3Dpk+wu4qZSlDOg9q+2N7OKof k/KMD0hLPu52z8SvPfqFdQcdzGMGsLxC3VhKO8s8pUeM6bxPIuTgsRX6U+tUkRBFzjoAIqj34M Xg0= WDCIronportException: Internal Received: from unknown (HELO redsun91.ssa.fujisawa.hgst.com) ([10.149.66.72]) by uls-op-cesaip02.wdc.com with ESMTP; 18 May 2022 02:17:22 -0700 From: Johannes Thumshirn To: linux-btrfs@vger.kernel.org Cc: Johannes Thumshirn Subject: [RFC ONLY 6/6] btrfs-progs: load zone info for all zoned devices Date: Wed, 18 May 2022 02:17:16 -0700 Message-Id: <20220518091716.786452-7-johannes.thumshirn@wdc.com> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20220518091716.786452-1-johannes.thumshirn@wdc.com> References: <20220518091716.786452-1-johannes.thumshirn@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org Signed-off-by: Johannes Thumshirn --- mkfs/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mkfs/main.c b/mkfs/main.c index 881de53b11fe..a43dae0ee253 100644 --- a/mkfs/main.c +++ b/mkfs/main.c @@ -1638,6 +1638,10 @@ int BOX_MAIN(mkfs)(int argc, char **argv) } } + + if (zoned) + btrfs_get_dev_zone_info_all_devices(fs_info); + raid_groups: ret = create_raid_groups(trans, root, data_profile, metadata_profile, mixed, &allocation);