]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - crypto.c
convert main() from C to Rust
[bcachefs-tools-debian] / crypto.c
index 4e4d15a90fe90d7fdbf051cd122c85353c162f69..32671bd84c332e90deb0510743443faf41df6c45 100644 (file)
--- a/crypto.c
+++ b/crypto.c
@@ -105,7 +105,7 @@ bool bch2_sb_is_encrypted(struct bch_sb *sb)
 {
        struct bch_sb_field_crypt *crypt;
 
-       return (crypt = bch2_sb_get_crypt(sb)) &&
+       return (crypt = bch2_sb_field_get(sb, crypt)) &&
                bch2_key_is_encrypted(&crypt->key);
 }
 
@@ -113,7 +113,7 @@ void bch2_passphrase_check(struct bch_sb *sb, const char *passphrase,
                           struct bch_key *passphrase_key,
                           struct bch_encrypted_key *sb_key)
 {
-       struct bch_sb_field_crypt *crypt = bch2_sb_get_crypt(sb);
+       struct bch_sb_field_crypt *crypt = bch2_sb_field_get(sb, crypt);
        if (!crypt)
                die("filesystem is not encrypted");