]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: use EXPORT_FOR_TESTS for conditionally exported functions
authorJohannes Thumshirn <jthumshirn@suse.de>
Mon, 19 Nov 2018 09:38:17 +0000 (10:38 +0100)
committerDavid Sterba <dsterba@suse.com>
Mon, 17 Dec 2018 13:51:37 +0000 (14:51 +0100)
commit4319fd134254ece00e17176857e270fb0943e9c9
treeb58442541dbac871d1b42d877f66bc1662ef9b08
parentc50d9150e0f64ab3875046ccaca31f81f31f30d8
btrfs: use EXPORT_FOR_TESTS for conditionally exported functions

Several functions in BTRFS are only used inside the source file they are
declared if CONFIG_BTRFS_FS_RUN_SANITY_TESTS is not defined. However if
CONFIG_BTRFS_FS_RUN_SANITY_TESTS is defined these functions are shared
with the unit tests code.

Before the introduction of the EXPORT_FOR_TESTS macro, these functions
could not be declared as static and the compiler had a harder task when
optimizing and inlining them.

As we have EXPORT_FOR_TESTS now, use it where appropriate to support the
compiler.

Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/extent_io.c
fs/btrfs/extent_io.h
fs/btrfs/free-space-tree.c
fs/btrfs/tests/extent-io-tests.c