mirror of
https://github.com/koverstreet/bcachefs-tools.git
synced 2025-02-23 00:00:02 +03:00
refactor: rename function again
`bch2_sb_is_encrypted_and_locked()` simply does not check if the fs is locked. The name is misleading. Signed-off-by: Thomas Mühlbacher <tmuehlbacher@posteo.net>
This commit is contained in:
parent
21b1111b59
commit
25bce91b4b
@ -66,7 +66,7 @@ int cmd_unlock(int argc, char *argv[])
|
||||
if (ret)
|
||||
die("Error opening %s: %s", dev, bch2_err_str(ret));
|
||||
|
||||
if (!bch2_sb_is_encrypted_and_locked(sb.sb))
|
||||
if (!bch2_sb_is_encrypted(sb.sb))
|
||||
die("%s is not encrypted", dev);
|
||||
|
||||
if (check)
|
||||
|
@ -101,7 +101,7 @@ struct bch_key derive_passphrase(struct bch_sb_field_crypt *crypt,
|
||||
return key;
|
||||
}
|
||||
|
||||
bool bch2_sb_is_encrypted_and_locked(struct bch_sb *sb)
|
||||
bool bch2_sb_is_encrypted(struct bch_sb *sb)
|
||||
{
|
||||
struct bch_sb_field_crypt *crypt;
|
||||
|
||||
|
@ -12,7 +12,7 @@ char *read_passphrase(const char *);
|
||||
char *read_passphrase_twice(const char *);
|
||||
|
||||
struct bch_key derive_passphrase(struct bch_sb_field_crypt *, const char *);
|
||||
bool bch2_sb_is_encrypted_and_locked(struct bch_sb *);
|
||||
bool bch2_sb_is_encrypted(struct bch_sb *);
|
||||
void bch2_passphrase_check(struct bch_sb *, const char *,
|
||||
struct bch_key *, struct bch_encrypted_key *);
|
||||
void bch2_add_key(struct bch_sb *, const char *, const char *, const char *);
|
||||
|
@ -344,7 +344,7 @@ fn cmd_mount_inner(opt: Cli) -> anyhow::Result<()> {
|
||||
.unwrap();
|
||||
|
||||
// Check if the filesystem's master key is encrypted and we don't have a key
|
||||
if unsafe { bcachefs::bch2_sb_is_encrypted_and_locked(block_devices_to_mount[0].sb) }
|
||||
if unsafe { bcachefs::bch2_sb_is_encrypted(block_devices_to_mount[0].sb) }
|
||||
&& !key::check_for_key(&key_name)?
|
||||
{
|
||||
// First by password_file, if available
|
||||
|
Loading…
Reference in New Issue
Block a user