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:
parent
4696bb8b7d
commit
b3d0a3ab25
13 changed files with 86 additions and 70 deletions
|
|
@ -19,8 +19,7 @@ pub struct MemoryNode {
|
|||
impl MemoryNode {
|
||||
/// Load a node from the store by key.
|
||||
pub fn load(key: &str) -> Option<Self> {
|
||||
let arc = super::access_local().ok()?;
|
||||
let store = arc.try_lock().ok()?;
|
||||
let store = super::access_local().ok()?;
|
||||
Self::from_store(&store, key)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue