btrfs: hide test-only member under ifdef
authorDavid Sterba <dsterba@suse.com>
Fri, 15 Jul 2016 13:23:37 +0000 (15:23 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 26 Jul 2016 11:52:25 +0000 (13:52 +0200)
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ctree.h
fs/btrfs/extent-tree.c

index 83a6a931af09b96ad998a797378a9d43b7da6ba7..8627b7f26a60f1567d51f461257213b146f3a59a 100644 (file)
@@ -1181,8 +1181,10 @@ struct btrfs_root {
 
        u64 highest_objectid;
 
+#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
        /* only used with CONFIG_BTRFS_FS_RUN_SANITY_TESTS is enabled */
        u64 alloc_bytenr;
+#endif
 
        u64 defrag_trans_start;
        struct btrfs_key defrag_progress;
index 3bb9607edc5d9a63630e2a93b783de08955b29da..81d83300c99b4d93a3a8b358a34e2b8a687d5c58 100644 (file)
@@ -8354,6 +8354,7 @@ struct extent_buffer *btrfs_alloc_tree_block(struct btrfs_trans_handle *trans,
        bool skinny_metadata = btrfs_fs_incompat(root->fs_info,
                                                 SKINNY_METADATA);
 
+#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
        if (btrfs_test_is_dummy_root(root)) {
                buf = btrfs_init_new_buffer(trans, root, root->alloc_bytenr,
                                            level);
@@ -8361,6 +8362,7 @@ struct extent_buffer *btrfs_alloc_tree_block(struct btrfs_trans_handle *trans,
                        root->alloc_bytenr += blocksize;
                return buf;
        }
+#endif
 
        block_rsv = use_block_rsv(trans, root, blocksize);
        if (IS_ERR(block_rsv))