Skip to content

Commit

Permalink
introduce "list_bkeys" command
Browse files Browse the repository at this point in the history
This introduces a new command, "list_bkeys", which is used to list the
known bkey types as well as their fields. This will be used by debug
tooling introduced in a subsequent change.

Signed-off-by: Thomas Bertschinger <[email protected]>
Signed-off-by: Kent Overstreet <[email protected]>
  • Loading branch information
bertschingert authored and Kent Overstreet committed Jul 14, 2024
1 parent 74f79f1 commit f4ca982
Show file tree
Hide file tree
Showing 6 changed files with 478 additions and 2 deletions.
141 changes: 141 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ byteorder = "1.3"
strum = { version = "0.26", features = ["derive"] }
strum_macros = "0.26"
zeroize = { version = "1", features = ["std", "zeroize_derive"] }
gimli = "0.29.0"
object = "0.35.0"
memmap2 = "0.9.4"
nom = "7.1.3"

[dependencies.env_logger]
version = "0.10"
Expand Down
4 changes: 2 additions & 2 deletions src/bcachefs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ fn handle_c_command(mut argv: Vec<String>, symlink_cmd: Option<&str>) -> i32 {

let argc: i32 = argv.len().try_into().unwrap();

let argv: Vec<_> = argv.into_iter().map(|s| CString::new(s).unwrap()).collect();
let argv = argv.into_iter().map(|s| CString::new(s).unwrap());
let mut argv = argv
.into_iter()
.map(|s| Box::into_raw(s.into_boxed_c_str()).cast::<c_char>())
.collect::<Box<[*mut c_char]>>();
let argv = argv.as_mut_ptr();
Expand Down Expand Up @@ -108,6 +107,7 @@ fn main() -> ExitCode {
ExitCode::SUCCESS
}
"list" => commands::list(args[1..].to_vec()).report(),
"list_bkeys" => commands::list_bkeys().report(),
"mount" => commands::mount(args, symlink_cmd).report(),
"subvolume" => commands::subvolume(args[1..].to_vec()).report(),
_ => ExitCode::from(u8::try_from(handle_c_command(args, symlink_cmd)).unwrap()),
Expand Down
Loading

0 comments on commit f4ca982

Please sign in to comment.