mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-12-10 00:00:24 +03:00
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:
parent
411df4e53f
commit
cf180e8f34
@ -339,7 +339,7 @@ fn cmd_mount_inner(opt: Cli) -> Result<()> {
|
|||||||
if unsafe { bcachefs::bch2_sb_is_encrypted(first_sb.sb) } {
|
if unsafe { bcachefs::bch2_sb_is_encrypted(first_sb.sb) } {
|
||||||
let _key_handle: KeyHandle = KeyHandle::new_from_search(&uuid).or_else(|_| {
|
let _key_handle: KeyHandle = KeyHandle::new_from_search(&uuid).or_else(|_| {
|
||||||
opt.passphrase_file
|
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)),
|
Ok(p) => Some(KeyHandle::new(&first_sb, &p)),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
error!(
|
error!(
|
||||||
|
|||||||
@ -168,12 +168,11 @@ impl Passphrase {
|
|||||||
Ok(Self(CString::new(passphrase.trim_end_matches('\n'))?))
|
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();
|
let passphrase_file = passphrase_file.as_ref();
|
||||||
|
|
||||||
info!(
|
info!(
|
||||||
"Attempting to unlock key for filesystem {} with passphrase from file {}",
|
"Attempting to unlock key with passphrase from file {}",
|
||||||
sb.sb().uuid(),
|
|
||||||
passphrase_file.display()
|
passphrase_file.display()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user