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
parent 09b30d64f2
commit 1d88293ccf
6 changed files with 17 additions and 51 deletions

View file

@ -389,8 +389,8 @@ impl Mind {
pub async fn subconscious_snapshots(&self) -> Vec<SubconsciousSnapshot> {
// Lock ordering: subconscious → store (store is bottom-most).
let sub = self.subconscious.lock().await;
let store = crate::store::Store::cached().await.ok();
let store_guard = match &store {
let store_arc = crate::hippocampus::access_local().ok();
let store_guard = match &store_arc {
Some(s) => Some(s.lock().await),
None => None,
};
@ -403,8 +403,8 @@ impl Mind {
pub async fn unconscious_snapshots(&self) -> Vec<UnconsciousSnapshot> {
let unc = self.unconscious.lock().await;
let store = crate::store::Store::cached().await.ok();
let store_guard = match &store {
let store_arc = crate::hippocampus::access_local().ok();
let store_guard = match &store_arc {
Some(s) => Some(s.lock().await),
None => None,
};