forked from kent/consciousness
cmd_fsck: use access_local(), remove dead AnyView::load()
Convert cmd_fsck to async and use access_local() for the cached store. Still uses Store::load_from_logs() for fresh comparison. Remove unused AnyView::load() method - was never called. Remaining Store::load() calls are all internal caching infrastructure: - persist.rs cached() for CACHED_STORE - mod.rs access() fallback for STORE_ACCESS Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
f6f330b07b
commit
09b30d64f2
3 changed files with 5 additions and 16 deletions
|
|
@ -6,7 +6,6 @@
|
|||
|
||||
use super::types::*;
|
||||
|
||||
use anyhow::Result;
|
||||
use std::fs;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
@ -185,17 +184,6 @@ pub enum AnyView {
|
|||
Owned(Store),
|
||||
}
|
||||
|
||||
impl AnyView {
|
||||
/// Load the fastest available view: mmap snapshot or owned store.
|
||||
pub fn load() -> Result<Self> {
|
||||
if let Some(mv) = MmapView::open() {
|
||||
Ok(AnyView::Mmap(mv))
|
||||
} else {
|
||||
Ok(AnyView::Owned(Store::load()?))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl StoreView for AnyView {
|
||||
fn for_each_node<F: FnMut(&str, &str, f32)>(&self, f: F) {
|
||||
match self { AnyView::Mmap(v) => v.for_each_node(f), AnyView::Owned(s) => s.for_each_node(f) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue