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
|
|
@ -59,8 +59,9 @@ pub async fn cmd_init() -> Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
pub fn cmd_fsck() -> Result<()> {
|
||||
let mut store = store::Store::load()?;
|
||||
pub async fn cmd_fsck() -> Result<()> {
|
||||
let arc = memory::access_local()?;
|
||||
let mut store = arc.lock().await;
|
||||
|
||||
// Check cache vs log consistency
|
||||
let log_store = store::Store::load_from_logs()?;
|
||||
|
|
@ -92,7 +93,7 @@ pub fn cmd_fsck() -> Result<()> {
|
|||
|
||||
if cache_issues > 0 {
|
||||
eprintln!("{} cache inconsistencies found — rebuilding from logs", cache_issues);
|
||||
store = log_store;
|
||||
*store = log_store;
|
||||
store.save().context("rebuild save")?;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue