btrfs: switch compression callbacks to direct calls

The indirect calls bring some overhead due to spectre vulnerability
mitigations. The number of cases is small and below the threshold
(10-20) where indirect call would be better.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
David Sterba
2019-10-02 00:06:15 +02:00
parent c4bf665a31
commit 1e4eb74654
5 changed files with 69 additions and 34 deletions

View File

@@ -420,9 +420,6 @@ const struct btrfs_compress_op btrfs_zlib_compress = {
.put_workspace = zlib_put_workspace,
.alloc_workspace = zlib_alloc_workspace,
.free_workspace = zlib_free_workspace,
.compress_pages = zlib_compress_pages,
.decompress_bio = zlib_decompress_bio,
.decompress = zlib_decompress,
.max_level = 9,
.default_level = BTRFS_ZLIB_DEFAULT_LEVEL,
};