From: Josef Bacik <josef@toxicpanda.com>
To: linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: [PATCH 08/15] btrfs-progs: do not remove metadata backrefs for extent tree v2
Date: Wed, 15 Dec 2021 15:14:46 -0500 [thread overview]
Message-ID: <73c54153be7f526c27839a9f09b07e6d75f5d0c1.1639598612.git.josef@toxicpanda.com> (raw)
In-Reply-To: <cover.1639598612.git.josef@toxicpanda.com>
We do not have backrefs for metadata in extent tree v2, skip this work
in __free_extent() and simply do the update of the accounting and free
space tree.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
kernel-shared/extent-tree.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/kernel-shared/extent-tree.c b/kernel-shared/extent-tree.c
index 7beff7ee..0c0d7bb9 100644
--- a/kernel-shared/extent-tree.c
+++ b/kernel-shared/extent-tree.c
@@ -1961,11 +1961,16 @@ static int __free_extent(struct btrfs_trans_handle *trans,
owner_offset, refs_to_drop);
}
+
+ is_data = owner_objectid >= BTRFS_FIRST_FREE_OBJECTID;
+
+ if (btrfs_fs_incompat(trans->fs_info, EXTENT_TREE_V2) && !is_data)
+ return do_free_extent_accounting(trans, bytenr, num_bytes, false);
+
path = btrfs_alloc_path();
if (!path)
return -ENOMEM;
- is_data = owner_objectid >= BTRFS_FIRST_FREE_OBJECTID;
if (is_data)
skinny_metadata = 0;
BUG_ON(!is_data && refs_to_drop != 1);
--
2.26.3
next prev parent reply other threads:[~2021-12-15 20:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-15 20:14 [PATCH 00/15] btrfs-progs: extent tree v2 gc tree and metadata ref changes Josef Bacik
2021-12-15 20:14 ` [PATCH 01/15] btrfs-progs: extract out free extent accounting handling Josef Bacik
2021-12-15 20:14 ` [PATCH 02/15] btrfs-progs: check: skip owner ref check for extent tree v2 Josef Bacik
2021-12-15 20:14 ` [PATCH 03/15] btrfs-progs: check: skip extent backref for metadata in " Josef Bacik
2021-12-15 20:14 ` [PATCH 04/15] btrfs-progs: check: calculate normal flags for extent tree v2 metadata Josef Bacik
2021-12-15 20:14 ` [PATCH 05/15] btrfs-progs: check: make metadata ref counting extent tree v2 aware Josef Bacik
2021-12-15 20:14 ` [PATCH 06/15] btrfs-progs: check: update block group used properly for extent tree v2 Josef Bacik
2021-12-15 20:14 ` [PATCH 07/15] btrfs-progs: do not insert extent items for metadata " Josef Bacik
2021-12-15 20:14 ` Josef Bacik [this message]
2021-12-15 20:14 ` [PATCH 09/15] btrfs-progs: repair: traverse tree blocks " Josef Bacik
2021-12-15 20:14 ` [PATCH 10/15] btrfs-progs: cache the block group with the free space tree if possible Josef Bacik
2021-12-15 20:14 ` [PATCH 11/15] btrfs-progs: make btrfs_lookup_extent_info extent tree v2 aware Josef Bacik
2021-12-15 20:14 ` [PATCH 12/15] btrfs-progs: mkfs: don't populate extent tree with extent tree v2 Josef Bacik
2021-12-15 20:14 ` [PATCH 13/15] btrfs-progs: add on-disk items and read support for the gc tree Josef Bacik
2021-12-15 20:14 ` [PATCH 14/15] btrfs-progs: mkfs: create the gc tree at mkfs time Josef Bacik
2021-12-15 20:14 ` [PATCH 15/15] btrfs-progs: deal with GC items in check Josef Bacik
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=73c54153be7f526c27839a9f09b07e6d75f5d0c1.1639598612.git.josef@toxicpanda.com \
--to=josef@toxicpanda.com \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).