btrfs: move checks for DUMMY_ROOT into a helper

Signed-off-by: David Sterba <dsterba@suse.cz>
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 533657c5..ce1d71d 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -1506,10 +1506,9 @@
 				   struct btrfs_root *root,
 				   struct extent_buffer *buf)
 {
-#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
-	if (unlikely(test_bit(BTRFS_ROOT_DUMMY_ROOT, &root->state)))
+	if (btrfs_test_is_dummy_root(root))
 		return 0;
-#endif
+
 	/* ensure we can see the force_cow */
 	smp_rmb();