store: internal locking, remove Arc<Mutex<Store>> wrapper

Store now has internal Mutex for capnp appends and AtomicU64 for
size tracking. All methods take &self. The external Arc<Mutex<Store>>
is replaced with Arc<Store>.

- Store::append_lock protects file appends
- local.rs functions take &Store (not &mut Store)
- access_local() returns Arc<Store>
- All .lock().await calls removed from callers

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
Kent Overstreet 2026-04-13 21:49:54 -04:00
parent 4696bb8b7d
commit b3d0a3ab25
13 changed files with 86 additions and 70 deletions

View file

@ -8,8 +8,7 @@ use anyhow::{bail, Result};
use crate::hippocampus as memory;
pub async fn cmd_cap_degree(max_deg: usize) -> Result<()> {
let arc = memory::access_local()?;
let mut store = arc.lock().await;
let store = memory::access_local()?;
let (hubs, pruned) = store.cap_degree(max_deg)?;
store.save()?;
println!("Capped {} hubs, pruned {} weak Auto edges (max_degree={})", hubs, pruned, max_deg);