"gag",
"libc",
"memoffset",
+ "paste",
"pkg-config",
"udev",
"uuid",
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3"
+[[package]]
+name = "paste"
+version = "1.0.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba"
+
[[package]]
name = "peeking_take_while"
version = "0.1.2"
.allowlist_var("BTREE_ITER.*")
.blocklist_item("bch2_bkey_ops")
.allowlist_type("bch_.*")
+ .allowlist_type("fsck_err_opts")
+ .rustified_enum("fsck_err_opts")
.allowlist_type("nonce")
.no_debug("bch_replicas_padded")
.newtype_enum("bch_kdf_types")
#include "../libbcachefs/bcachefs_format.h"
#include "../libbcachefs/btree_iter.h"
#include "../libbcachefs/errcode.h"
+#include "../libbcachefs/error.h"
#include "../libbcachefs/opts.h"
#include "../libbcachefs.h"
#include "../crypto.h"
use atty::Stream;
use bch_bindgen::error;
use bch_bindgen::bcachefs;
+use bch_bindgen::opt_set;
use bch_bindgen::fs::Fs;
use bch_bindgen::btree::BtreeTrans;
use bch_bindgen::btree::BtreeIter;
}
println!("{}", k.to_text(fs));
-
iter.advance();
}
colorize: bool,
/// Verbose mode
- #[arg(short, long, action = clap::ArgAction::Count)]
- verbose: u8,
+ #[arg(short, long)]
+ verbose: bool,
#[arg(required(true))]
devices: Vec<std::path::PathBuf>,
}
fn cmd_list_inner(opt: Cli) -> anyhow::Result<()> {
- let fs_opts: bcachefs::bch_opts = Default::default();
+ let mut fs_opts: bcachefs::bch_opts = Default::default();
+
+ opt_set!(fs_opts, nochanges, 1);
+ opt_set!(fs_opts, norecovery, 1);
+ opt_set!(fs_opts, degraded, 1);
+ opt_set!(fs_opts, errors, bcachefs::bch_error_actions::BCH_ON_ERROR_continue as u8);
+
+ if opt.fsck {
+ opt_set!(fs_opts, fix_errors, bcachefs::fsck_err_opts::FSCK_OPT_YES as u8);
+ opt_set!(fs_opts, norecovery, 0);
+ }
+
+ if opt.verbose {
+ opt_set!(fs_opts, verbose, 1);
+ }
let fs = Fs::open(&opt.devices, fs_opts)?;