Commit 6a6b4daf authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba
Browse files

btrfs: move CONFIG_BTRFS_FS_RUN_SANITY_TESTS checks to fs.h



We already have a few of these in fs.h, move the remaining checks out of
ctree.h into fs.h.

Reviewed-by: default avatarJohannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: default avatarJosef Bacik <josef@toxicpanda.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 5c11adcc
Loading
Loading
Loading
Loading
+0 −15
Original line number Diff line number Diff line
@@ -722,16 +722,6 @@ static inline unsigned long get_eb_page_index(unsigned long offset)
	return offset >> PAGE_SHIFT;
}

/*
 * Use that for functions that are conditionally exported for sanity tests but
 * otherwise static
 */
#ifndef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
#define EXPORT_FOR_TESTS static
#else
#define EXPORT_FOR_TESTS
#endif

static inline int is_fstree(u64 rootid)
{
	if (rootid == BTRFS_FS_TREE_OBJECTID ||
@@ -741,11 +731,6 @@ static inline int is_fstree(u64 rootid)
	return 0;
}

/* Sanity test specific functions */
#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
void btrfs_test_destroy_inode(struct inode *inode);
#endif

static inline bool btrfs_is_data_reloc_root(const struct btrfs_root *root)
{
	return root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID;
+9 −0
Original line number Diff line number Diff line
@@ -971,11 +971,20 @@ static inline void btrfs_wake_unfinished_drop(struct btrfs_fs_info *fs_info)
			   &(fs_info)->fs_state)))

#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS

#define EXPORT_FOR_TESTS

static inline int btrfs_is_testing(struct btrfs_fs_info *fs_info)
{
	return test_bit(BTRFS_FS_STATE_DUMMY_FS_INFO, &fs_info->fs_state);
}

void btrfs_test_destroy_inode(struct inode *inode);

#else

#define EXPORT_FOR_TESTS static

static inline int btrfs_is_testing(struct btrfs_fs_info *fs_info)
{
	return 0;