diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-11-01 10:37:53 +0300 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-23 00:09:45 +0300 |
commit | 0cc455b3ca5ffc9b0d5e9b1a21a9f3cd7fde8247 (patch) | |
tree | 079be9f81453b090a5d5bf88aba72e64e9ff8e7c /fs/bcachefs/checksum.h | |
parent | 182c7bbfbfe8d435672b8cb9730b07e88e103670 (diff) | |
download | linux-0cc455b3ca5ffc9b0d5e9b1a21a9f3cd7fde8247.tar.xz |
bcachefs: Inlining improvements
- Don't call into bch2_encrypt_bio() when we're not encrypting
- Pull slowpath out of trans_lock_write()
- Make sure bc2h_trans_journal_res_get() gets inlined.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/checksum.h')
-rw-r--r-- | fs/bcachefs/checksum.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/fs/bcachefs/checksum.h b/fs/bcachefs/checksum.h index 3d6d13bcfd72..f7ccef7a5520 100644 --- a/fs/bcachefs/checksum.h +++ b/fs/bcachefs/checksum.h @@ -61,8 +61,16 @@ int bch2_rechecksum_bio(struct bch_fs *, struct bio *, struct bversion, struct bch_extent_crc_unpacked *, unsigned, unsigned, unsigned); -int bch2_encrypt_bio(struct bch_fs *, unsigned, - struct nonce, struct bio *); +int __bch2_encrypt_bio(struct bch_fs *, unsigned, + struct nonce, struct bio *); + +static inline int bch2_encrypt_bio(struct bch_fs *c, unsigned type, + struct nonce nonce, struct bio *bio) +{ + return bch2_csum_type_is_encryption(type) + ? __bch2_encrypt_bio(c, type, nonce, bio) + : 0; +} int bch2_decrypt_sb_key(struct bch_fs *, struct bch_sb_field_crypt *, struct bch_key *); |