]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bcachefs: #if 0 out (enable|disable)_encryption()
authorKent Overstreet <kent.overstreet@linux.dev>
Sun, 16 Mar 2025 17:39:14 +0000 (13:39 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 24 Mar 2025 13:50:34 +0000 (09:50 -0400)
These weren't hooked up, but they probably should be - add some comments
for context.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/checksum.c
fs/bcachefs/checksum.h

index 23a383577d4c7908fbe1aed9d035531d1b46e447..15de9d794337dea3c555ff943a07353fb7875e35 100644 (file)
@@ -693,6 +693,14 @@ static int bch2_alloc_ciphers(struct bch_fs *c)
        return 0;
 }
 
+#if 0
+
+/*
+ * This seems to be duplicating code in cmd_remove_passphrase() in
+ * bcachefs-tools, but we might want to switch userspace to use this - and
+ * perhaps add an ioctl for calling this at runtime, so we can take the
+ * passphrase off of a mounted filesystem (which has come up).
+ */
 int bch2_disable_encryption(struct bch_fs *c)
 {
        struct bch_sb_field_crypt *crypt;
@@ -725,6 +733,10 @@ out:
        return ret;
 }
 
+/*
+ * For enabling encryption on an existing filesystem: not hooked up yet, but it
+ * should be
+ */
 int bch2_enable_encryption(struct bch_fs *c, bool keyed)
 {
        struct bch_encrypted_key key;
@@ -781,6 +793,7 @@ err:
        memzero_explicit(&key, sizeof(key));
        return ret;
 }
+#endif
 
 void bch2_fs_encryption_exit(struct bch_fs *c)
 {
index 43b9d71f2f2b46fa184b428f64ba704167922d94..4ac251c8fcd839b94a3406581c057312c1f64ccf 100644 (file)
@@ -103,8 +103,10 @@ extern const struct bch_sb_field_ops bch_sb_field_ops_crypt;
 int bch2_decrypt_sb_key(struct bch_fs *, struct bch_sb_field_crypt *,
                        struct bch_key *);
 
+#if 0
 int bch2_disable_encryption(struct bch_fs *);
 int bch2_enable_encryption(struct bch_fs *, bool);
+#endif
 
 void bch2_fs_encryption_exit(struct bch_fs *);
 int bch2_fs_encryption_init(struct bch_fs *);