1
0
mirror of https://github.com/Zygo/bees.git synced 2025-05-18 05:45:45 +02:00

crawl: rename next_transid() to avoid confusion with BeesScanMode::next_transid()

Signed-off-by: Zygo Blaxell <bees@furryterror.org>
This commit is contained in:
Zygo Blaxell 2024-11-30 12:49:22 -05:00
parent b408eac98e
commit a7baa565e4
2 changed files with 5 additions and 5 deletions

View File

@ -1320,7 +1320,7 @@ BeesCrawl::BeesCrawl(shared_ptr<BeesContext> ctx, BeesCrawlState initial_state)
} }
bool bool
BeesCrawl::next_transid() BeesCrawl::restart_crawl()
{ {
const auto roots = m_ctx->roots(); const auto roots = m_ctx->roots();
const auto next_transid = roots->transid_max(); const auto next_transid = roots->transid_max();
@ -1365,7 +1365,7 @@ BeesCrawl::fetch_extents()
// We can't scan an empty transid interval. // We can't scan an empty transid interval.
if (m_finished || old_state.m_max_transid <= old_state.m_min_transid) { if (m_finished || old_state.m_max_transid <= old_state.m_min_transid) {
return next_transid(); return restart_crawl();
} }
// Check for btrfs send workaround: don't scan RO roots at all, pretend // Check for btrfs send workaround: don't scan RO roots at all, pretend
@ -1376,7 +1376,7 @@ BeesCrawl::fetch_extents()
if (m_ctx->is_root_ro(old_state.m_root)) { if (m_ctx->is_root_ro(old_state.m_root)) {
BEESLOGDEBUG("WORKAROUND: skipping scan of RO root " << old_state.m_root); BEESLOGDEBUG("WORKAROUND: skipping scan of RO root " << old_state.m_root);
BEESCOUNT(root_workaround_btrfs_send); BEESCOUNT(root_workaround_btrfs_send);
// We would call next_transid() here, but we want to do a few things differently. // We would call restart_crawl() here, but we want to do a few things differently.
// We immediately defer further crawling on this subvol. // We immediately defer further crawling on this subvol.
// We track max_transid if the subvol scan has never started. // We track max_transid if the subvol scan has never started.
// We postpone the started timestamp since we haven't started. // We postpone the started timestamp since we haven't started.
@ -1418,7 +1418,7 @@ BeesCrawl::fetch_extents()
if (!m_next_extent_data) { if (!m_next_extent_data) {
// Ran out of data in this subvol and transid. // Ran out of data in this subvol and transid.
// Try to restart immediately if more transids are available. // Try to restart immediately if more transids are available.
return next_transid(); return restart_crawl();
} }
auto new_state = old_state; auto new_state = old_state;
new_state.m_objectid = max(m_next_extent_data.objectid() + 1, m_next_extent_data.objectid()); new_state.m_objectid = max(m_next_extent_data.objectid() + 1, m_next_extent_data.objectid());

View File

@ -515,7 +515,7 @@ class BeesCrawl {
bool fetch_extents(); bool fetch_extents();
void fetch_extents_harder(); void fetch_extents_harder();
bool next_transid(); bool restart_crawl();
BeesFileRange bti_to_bfr(const BtrfsTreeItem &bti) const; BeesFileRange bti_to_bfr(const BtrfsTreeItem &bti) const;
public: public: