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>
This commit is contained in:
Thomas Mühlbacher 2024-06-26 14:53:37 +02:00
parent 411df4e53f
commit cf180e8f34
2 changed files with 3 additions and 4 deletions
src

View File

@ -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!(

View File

@ -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()
);