From 7a8d98f94d04c19572886ae1048af9c79848d66b Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Thu, 14 Oct 2021 18:35:48 -0400 Subject: [PATCH] roots: use the new type argument to next_min Tree searches are all looking for specific item types. Skip over any item types we are not interested in when resetting the search key for the next search. Signed-off-by: Zygo Blaxell --- src/bees-roots.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/bees-roots.cc b/src/bees-roots.cc index 411f9b4..0625d19 100644 --- a/src/bees-roots.cc +++ b/src/bees-roots.cc @@ -220,7 +220,7 @@ BeesRoots::transid_max_nocache() // We are just looking for the highest transid on the filesystem. // We don't care which object it comes from. for (auto i : sk.m_result) { - sk.next_min(i); + sk.next_min(i, BTRFS_ROOT_ITEM_KEY); if (i.transid > rv) { rv = i.transid; } @@ -639,7 +639,7 @@ BeesRoots::open_root_nocache(uint64_t rootid) } for (auto i : sk.m_result) { - sk.next_min(i); + sk.next_min(i, BTRFS_ROOT_BACKREF_KEY); if (i.type == BTRFS_ROOT_BACKREF_KEY && i.objectid == rootid) { auto dirid = btrfs_get_member(&btrfs_root_ref::dirid, i.m_data); auto name_len = btrfs_get_member(&btrfs_root_ref::name_len, i.m_data); @@ -775,7 +775,7 @@ BeesRoots::next_root(uint64_t root) } for (auto i : sk.m_result) { - sk.next_min(i); + sk.next_min(i, BTRFS_ROOT_BACKREF_KEY); if (i.type == BTRFS_ROOT_BACKREF_KEY) { // BEESLOGDEBUG("Found root " << i.objectid << " parent " << i.offset << " transid " << i.transid); return i.objectid; @@ -1087,7 +1087,7 @@ BeesCrawl::fetch_extents() size_t count_high = 0; BeesFileRange last_bfr; for (auto i : sk.m_result) { - sk.next_min(i); + sk.next_min(i, BTRFS_EXTENT_DATA_KEY); --results_left; BEESCOUNT(crawl_items);