From 77ef6a063893b10915dee72928f7e5279ae99e20 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Fri, 28 May 2021 02:09:55 -0400 Subject: [PATCH] roots: split constructor into separate start method This allows us to use the fd cache and inode resolve functions without starting crawler threads. Signed-off-by: Zygo Blaxell --- src/bees-context.cc | 2 +- src/bees-roots.cc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/bees-context.cc b/src/bees-context.cc index 5369e71..7e96252 100644 --- a/src/bees-context.cc +++ b/src/bees-context.cc @@ -987,7 +987,7 @@ BeesContext::start() hash_table(); // Kick off the crawlers - roots(); + roots()->start(); } void diff --git a/src/bees-roots.cc b/src/bees-roots.cc index 3a976ac..9a10e1a 100644 --- a/src/bees-roots.cc +++ b/src/bees-roots.cc @@ -546,12 +546,15 @@ BeesRoots::BeesRoots(shared_ptr ctx) : m_crawl_thread("crawl_transid"), m_writeback_thread("crawl_writeback") { - m_root_ro_cache.func([&](uint64_t root) -> bool { return is_root_ro_nocache(root); }); m_root_ro_cache.max_size(BEES_ROOT_FD_CACHE_SIZE); +} +void +BeesRoots::start() +{ m_crawl_thread.exec([&]() { // Measure current transid before creating any crawlers catch_all([&]() {