diff options
Diffstat (limited to 'dev-python/btrfs/files/13-006-btrfs-search-metadata-use-FileSystem-block_groups.patch')
-rw-r--r-- | dev-python/btrfs/files/13-006-btrfs-search-metadata-use-FileSystem-block_groups.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/dev-python/btrfs/files/13-006-btrfs-search-metadata-use-FileSystem-block_groups.patch b/dev-python/btrfs/files/13-006-btrfs-search-metadata-use-FileSystem-block_groups.patch new file mode 100644 index 000000000000..286282f73822 --- /dev/null +++ b/dev-python/btrfs/files/13-006-btrfs-search-metadata-use-FileSystem-block_groups.patch @@ -0,0 +1,30 @@ + +Patch from: +https://github.com/knorrie/python-btrfs/commit/59c8daca3a05f86001b1dc36b2ab2e5961bf7bc0 + +From 59c8daca3a05f86001b1dc36b2ab2e5961bf7bc0 Mon Sep 17 00:00:00 2001 +From: Hans van Kranenburg <hans@knorrie.org> +Date: Sun, 21 May 2023 18:48:55 +0200 +Subject: [PATCH] btrfs-search-metadata: use FileSystem block_groups + +Now that we have a helper for looking up Block Groups, let's use it, so +that it can deal with Block Groups in either Extent or Block Group Tree +automagically. +--- a/bin/btrfs-search-metadata ++++ b/bin/btrfs-search-metadata +@@ -37,14 +37,7 @@ def get_chunks(fs, **kwargs): + + + def get_block_groups(fs, **kwargs): +- for chunk in fs.chunks(): +- try: +- yield fs.block_group(chunk.vaddr, chunk.length) +- except btrfs.ctree.ItemNotFoundError: +- # This is simply to prevent the program from aborting when a block +- # group is removed in between doing the chunks lookup and the block +- # group item lookup. +- pass ++ return fs.block_groups() + + + def get_dev_extents(fs, **kwargs): |