diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-09-26 17:49:34 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:10:16 -0400 |
commit | 4637429e3946d083eedde1668c17a4fadaf3c0b1 (patch) | |
tree | e963537ab982b1a82fa0aa33afab53713ce33fa7 /fs/bcachefs/checksum.c | |
parent | be47e0ba4fc92bd065ac0b7ad345913eea1bc6fc (diff) | |
download | linux-4637429e3946d083eedde1668c17a4fadaf3c0b1.tar.gz linux-4637429e3946d083eedde1668c17a4fadaf3c0b1.tar.bz2 linux-4637429e3946d083eedde1668c17a4fadaf3c0b1.zip |
bcachefs: bch2_sb_field_get() refactoring
Instead of using token pasting to generate methods for each superblock
section, just make the type a parameter to bch2_sb_field_get().
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/checksum.c')
-rw-r--r-- | fs/bcachefs/checksum.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/bcachefs/checksum.c b/fs/bcachefs/checksum.c index 839f00dce50f..3c761ad6b1c8 100644 --- a/fs/bcachefs/checksum.c +++ b/fs/bcachefs/checksum.c @@ -678,7 +678,7 @@ int bch2_disable_encryption(struct bch_fs *c) mutex_lock(&c->sb_lock); - crypt = bch2_sb_get_crypt(c->disk_sb.sb); + crypt = bch2_sb_field_get(c->disk_sb.sb, crypt); if (!crypt) goto out; @@ -712,7 +712,7 @@ int bch2_enable_encryption(struct bch_fs *c, bool keyed) mutex_lock(&c->sb_lock); /* Do we already have an encryption key? */ - if (bch2_sb_get_crypt(c->disk_sb.sb)) + if (bch2_sb_field_get(c->disk_sb.sb, crypt)) goto err; ret = bch2_alloc_ciphers(c); @@ -740,7 +740,8 @@ int bch2_enable_encryption(struct bch_fs *c, bool keyed) if (ret) goto err; - crypt = bch2_sb_resize_crypt(&c->disk_sb, sizeof(*crypt) / sizeof(u64)); + crypt = bch2_sb_field_resize(&c->disk_sb, crypt, + sizeof(*crypt) / sizeof(u64)); if (!crypt) { ret = -BCH_ERR_ENOSPC_sb_crypt; goto err; @@ -781,7 +782,7 @@ int bch2_fs_encryption_init(struct bch_fs *c) goto out; } - crypt = bch2_sb_get_crypt(c->disk_sb.sb); + crypt = bch2_sb_field_get(c->disk_sb.sb, crypt); if (!crypt) goto out; |