btrfs: expose internal free space tree routine only if sanity tests are enabled
diff mbox

Message ID 1502896523-2431-1-git-send-email-nborisov@suse.com
State New
Headers show

Commit Message

Nikolay Borisov Aug. 16, 2017, 3:15 p.m. UTC
The internal free space tree management routines are always exposed for testing
purposes. Make them dependent on SANITY_TESTS being on so that they are exposed
only when they really have to.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/free-space-tree.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

David Sterba Aug. 17, 2017, 11:48 a.m. UTC | #1
On Wed, Aug 16, 2017 at 06:15:23PM +0300, Nikolay Borisov wrote:
> The internal free space tree management routines are always exposed for testing
> purposes. Make them dependent on SANITY_TESTS being on so that they are exposed
> only when they really have to.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

Reviewed-by: David Sterba <dsterba@suse.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/fs/btrfs/free-space-tree.h b/fs/btrfs/free-space-tree.h
index 54ffced3bce8..ba3787df43c3 100644
--- a/fs/btrfs/free-space-tree.h
+++ b/fs/btrfs/free-space-tree.h
@@ -44,7 +44,7 @@  int remove_from_free_space_tree(struct btrfs_trans_handle *trans,
 				struct btrfs_fs_info *fs_info,
 				u64 start, u64 size);
 
-/* Exposed for testing. */
+#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
 struct btrfs_free_space_info *
 search_free_space_info(struct btrfs_trans_handle *trans,
 		       struct btrfs_fs_info *fs_info,
@@ -68,5 +68,6 @@  int convert_free_space_to_extents(struct btrfs_trans_handle *trans,
 				  struct btrfs_path *path);
 int free_space_test_bit(struct btrfs_block_group_cache *block_group,
 			struct btrfs_path *path, u64 offset);
+#endif
 
 #endif