* fails during the stage where it updates the bytenr of file extent
         * items.
         */
-       if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID)
+       if (btrfs_is_data_reloc_root(root))
                min_alloc_size = num_bytes;
        else
                min_alloc_size = fs_info->sectorsize;
                if (ret)
                        goto out_drop_extent_cache;
 
-               if (root->root_key.objectid ==
-                   BTRFS_DATA_RELOC_TREE_OBJECTID) {
+               if (btrfs_is_data_reloc_root(root)) {
                        ret = btrfs_reloc_clone_csums(inode, start,
                                                      cur_alloc_size);
                        /*
                           int *page_started, unsigned long *nr_written)
 {
        const bool is_space_ino = btrfs_is_free_space_inode(inode);
-       const bool is_reloc_ino = (inode->root->root_key.objectid ==
-                                  BTRFS_DATA_RELOC_TREE_OBJECTID);
+       const bool is_reloc_ino = btrfs_is_data_reloc_root(inode->root);
        const u64 range_bytes = end + 1 - start;
        struct extent_io_tree *io_tree = &inode->io_tree;
        u64 range_start = start;
                        btrfs_dec_nocow_writers(fs_info, disk_bytenr);
                nocow = false;
 
-               if (root->root_key.objectid ==
-                   BTRFS_DATA_RELOC_TREE_OBJECTID)
+               if (btrfs_is_data_reloc_root(root))
                        /*
                         * Error handled later, as we must prevent
                         * extent_clear_unlock_delalloc() in error handler
                if (btrfs_is_testing(fs_info))
                        return;
 
-               if (root->root_key.objectid != BTRFS_DATA_RELOC_TREE_OBJECTID &&
+               if (!btrfs_is_data_reloc_root(root) &&
                    do_list && !(state->state & EXTENT_NORESERVE) &&
                    (*bits & EXTENT_CLEAR_DATA_RESV))
                        btrfs_free_reserved_data_space_noquota(fs_info, len);
                goto mapit;
        } else if (async && !skip_sum) {
                /* csum items have already been cloned */
-               if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID)
+               if (btrfs_is_data_reloc_root(root))
                        goto mapit;
                /* we're doing a write, do the async checksumming */
                ret = btrfs_wq_submit_bio(inode, bio, mirror_num, bio_flags,
                u64 file_offset = pg_off + page_offset(page);
                int ret;
 
-               if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID &&
+               if (btrfs_is_data_reloc_root(root) &&
                    test_range_bit(io_tree, file_offset,
                                   file_offset + sectorsize - 1,
                                   EXTENT_NODATASUM, 1, NULL)) {
         * without delay
         */
        if (!btrfs_is_free_space_inode(inode)
-           && root->root_key.objectid != BTRFS_DATA_RELOC_TREE_OBJECTID
+           && !btrfs_is_data_reloc_root(root)
            && !test_bit(BTRFS_FS_LOG_RECOVERING, &fs_info->flags)) {
                btrfs_update_root_times(trans, root);