Remove Store::cached(), consolidate on access_local()

- Remove CACHED_STORE, cached(), is_stale(), set_store() - redundant
- Convert all Store::cached() callers to use access_local()
- Single Store::load() call remains in access() fallback path

All store access now goes through hippocampus::access() / access_local(),
which handles socket connection or local fallback with caching.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-13 18:11:58 -04:00
commit 1d88293ccf
6 changed files with 17 additions and 51 deletions

View file

@ -44,14 +44,9 @@ pub enum StoreAccess {
None(String), // Error: couldn't get access
}
/// Set the global store handle. Call once at daemon startup (eager init).
pub fn set_store(store: Arc<crate::Mutex<Store>>) {
STORE_ACCESS.set(Some(store)).ok();
}
/// Get store access: daemon's store, socket, or local fallback.
pub fn access() -> StoreAccess {
// Daemon: already set via set_store()
// Check if already cached
if let Some(Some(store)) = STORE_ACCESS.get() {
return StoreAccess::Daemon(store.clone());
}