summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Mühlbacher <tmuehlbacher@posteo.net>2024-06-26 14:53:37 +0200
committerThomas Mühlbacher <tmuehlbacher@posteo.net>2024-06-26 19:14:45 +0200
commitcf180e8f34570c98aad838c998d55e4b15763645 (patch)
treec067d049d9a5568945c96f0fdaa67d5ef423d60f
parent411df4e53fdc58cfca2e473e54c1bed9cf17740d (diff)
refactor: rm function param only used for log msg
We lose that bit of info but it's weird to require a parameter simply because we want to use it for a log message. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
-rw-r--r--src/commands/mount.rs2
-rw-r--r--src/key.rs5
2 files changed, 3 insertions, 4 deletions
diff --git a/src/commands/mount.rs b/src/commands/mount.rs
index 5782b3ab..86149fa8 100644
--- a/src/commands/mount.rs
+++ b/src/commands/mount.rs
@@ -339,7 +339,7 @@ fn cmd_mount_inner(opt: Cli) -> Result<()> {
if unsafe { bcachefs::bch2_sb_is_encrypted(first_sb.sb) } {
let _key_handle: KeyHandle = KeyHandle::new_from_search(&uuid).or_else(|_| {
opt.passphrase_file
- .and_then(|path| match Passphrase::new_from_file(&first_sb, path) {
+ .and_then(|path| match Passphrase::new_from_file(path) {
Ok(p) => Some(KeyHandle::new(&first_sb, &p)),
Err(e) => {
error!(
diff --git a/src/key.rs b/src/key.rs
index 0e061ee5..81d4e3c0 100644
--- a/src/key.rs
+++ b/src/key.rs
@@ -168,12 +168,11 @@ impl Passphrase {
Ok(Self(CString::new(passphrase.trim_end_matches('\n'))?))
}
- pub fn new_from_file(sb: &bch_sb_handle, passphrase_file: impl AsRef<Path>) -> Result<Self> {
+ pub fn new_from_file(passphrase_file: impl AsRef<Path>) -> Result<Self> {
let passphrase_file = passphrase_file.as_ref();
info!(
- "Attempting to unlock key for filesystem {} with passphrase from file {}",
- sb.sb().uuid(),
+ "Attempting to unlock key with passphrase from file {}",
passphrase_file.display()
);