__entry->generation = BTRFS_I(inode)->generation;
                __entry->last_trans = BTRFS_I(inode)->last_trans;
                __entry->logged_trans = BTRFS_I(inode)->logged_trans;
-               __entry->root_objectid =
-                               BTRFS_I(inode)->root->root_key.objectid;
+               __entry->root_objectid = btrfs_root_id(BTRFS_I(inode)->root);
        ),
 
        TP_printk_btrfs("root=%llu(%s) gen=%llu ino=%llu blocks=%llu "
        ),
 
        TP_fast_assign_btrfs(root->fs_info,
-               __entry->root_objectid  = root->root_key.objectid;
+               __entry->root_objectid  = btrfs_root_id(root);
                __entry->ino            = btrfs_ino(inode);
                __entry->start          = map->start;
                __entry->len            = map->len;
        ),
 
        TP_fast_assign_btrfs(bi->root->fs_info,
-               __entry->root_obj       = bi->root->root_key.objectid;
+               __entry->root_obj       = btrfs_root_id(bi->root);
                __entry->ino            = btrfs_ino(bi);
                __entry->isize          = bi->vfs_inode.i_size;
                __entry->disk_isize     = bi->disk_i_size;
 
        TP_fast_assign_btrfs(
                bi->root->fs_info,
-               __entry->root_obj       = bi->root->root_key.objectid;
+               __entry->root_obj       = btrfs_root_id(bi->root);
                __entry->ino            = btrfs_ino(bi);
                __entry->isize          = bi->vfs_inode.i_size;
                __entry->disk_isize     = bi->disk_i_size;
                __entry->flags          = ordered->flags;
                __entry->compress_type  = ordered->compress_type;
                __entry->refs           = refcount_read(&ordered->refs);
-               __entry->root_objectid  = inode->root->root_key.objectid;
+               __entry->root_objectid  = btrfs_root_id(inode->root);
                __entry->truncated_len  = ordered->truncated_len;
        ),
 
                __entry->start  = start;
                __entry->len    = len;
                __entry->uptodate = uptodate;
-               __entry->root_objectid = inode->root->root_key.objectid;
+               __entry->root_objectid = btrfs_root_id(inode->root);
        ),
 
        TP_printk_btrfs("root=%llu(%s) ino=%llu start=%llu len=%llu uptodate=%d",
                __entry->for_reclaim    = wbc->for_reclaim;
                __entry->range_cyclic   = wbc->range_cyclic;
                __entry->writeback_index = inode->i_mapping->writeback_index;
-               __entry->root_objectid  =
-                                BTRFS_I(inode)->root->root_key.objectid;
+               __entry->root_objectid  = btrfs_root_id(BTRFS_I(inode)->root);
        ),
 
        TP_printk_btrfs("root=%llu(%s) ino=%llu page_index=%lu "
                __entry->start  = start;
                __entry->end    = end;
                __entry->uptodate = uptodate;
-               __entry->root_objectid = inode->root->root_key.objectid;
+               __entry->root_objectid = btrfs_root_id(inode->root);
        ),
 
        TP_printk_btrfs("root=%llu(%s) ino=%llu start=%llu end=%llu uptodate=%d",
                __entry->ino            = btrfs_ino(BTRFS_I(inode));
                __entry->parent         = btrfs_ino(BTRFS_I(d_inode(dentry->d_parent)));
                __entry->datasync       = datasync;
-               __entry->root_objectid  =
-                                BTRFS_I(inode)->root->root_key.objectid;
+               __entry->root_objectid  = btrfs_root_id(BTRFS_I(inode)->root);
        ),
 
        TP_printk_btrfs("root=%llu(%s) ino=%llu parent=%llu datasync=%d",
                __entry->sub_stripes    = map->sub_stripes;
                __entry->offset         = offset;
                __entry->size           = size;
-               __entry->root_objectid  = fs_info->chunk_root->root_key.objectid;
+               __entry->root_objectid  = btrfs_root_id(fs_info->chunk_root);
        ),
 
        TP_printk_btrfs("root=%llu(%s) offset=%llu size=%llu "
        ),
 
        TP_fast_assign_btrfs(root->fs_info,
-               __entry->root_objectid  = root->root_key.objectid;
+               __entry->root_objectid  = btrfs_root_id(root);
                __entry->buf_start      = buf->start;
                __entry->refs           = atomic_read(&buf->refs);
                __entry->cow_start      = cow->start;
        ),
 
        TP_fast_assign_btrfs(root->fs_info,
-               __entry->root_objectid  = root->root_key.objectid;
+               __entry->root_objectid  = btrfs_root_id(root);
                __entry->num_bytes      = ffe_ctl->num_bytes;
                __entry->empty_size     = ffe_ctl->empty_size;
                __entry->flags          = ffe_ctl->flags;
        ),
 
        TP_fast_assign_btrfs(root->fs_info,
-               __entry->root_objectid  = root->root_key.objectid;
+               __entry->root_objectid  = btrfs_root_id(root);
                __entry->num_bytes      = ffe_ctl->num_bytes;
                __entry->empty_size     = ffe_ctl->empty_size;
                __entry->flags          = ffe_ctl->flags;
        ),
 
        TP_fast_assign_btrfs(root->fs_info,
-               __entry->root_objectid  = root->root_key.objectid;
+               __entry->root_objectid  = btrfs_root_id(root);
                __entry->num_bytes      = ffe_ctl->num_bytes;
                __entry->empty_size     = ffe_ctl->empty_size;
                __entry->flags          = ffe_ctl->flags;
        ),
 
        TP_fast_assign_btrfs(btrfs_sb(inode->i_sb),
-               __entry->rootid         =
-                       BTRFS_I(inode)->root->root_key.objectid;
+               __entry->rootid         = btrfs_root_id(BTRFS_I(inode)->root);
                __entry->ino            = btrfs_ino(BTRFS_I(inode));
                __entry->start          = start;
                __entry->len            = len;
        ),
 
        TP_fast_assign_btrfs(root->fs_info,
-               __entry->refroot        = root->root_key.objectid;
+               __entry->refroot        = btrfs_root_id(root);
                __entry->diff           = diff;
                __entry->type           = type;
        ),
        ),
 
        TP_fast_assign_btrfs(root->fs_info,
-               __entry->refroot        = root->root_key.objectid;
+               __entry->refroot        = btrfs_root_id(root);
                __entry->diff           = diff;
        ),
 
        ),
 
        TP_fast_assign_btrfs(root->fs_info,
-               __entry->refroot        = root->root_key.objectid;
+               __entry->refroot        = btrfs_root_id(root);
                spin_lock(&root->qgroup_meta_rsv_lock);
                __entry->diff           = -(s64)root->qgroup_meta_rsv_pertrans;
                spin_unlock(&root->qgroup_meta_rsv_lock);
        ),
 
        TP_fast_assign_btrfs(root->fs_info,
-               __entry->root_objectid  = root->root_key.objectid;
+               __entry->root_objectid  = btrfs_root_id(root);
                __entry->ino            = ino;
                __entry->mod            = mod;
                __entry->outstanding    = outstanding;
 
                __entry->owner          = tree->owner;
                __entry->ino            = inode ? btrfs_ino(inode) : 0;
-               __entry->rootid         = inode ? inode->root->root_key.objectid : 0;
+               __entry->rootid         = inode ? btrfs_root_id(inode->root) : 0;
                __entry->start          = start;
                __entry->len            = len;
                __entry->set_bits       = set_bits;
 
                __entry->owner          = tree->owner;
                __entry->ino            = inode ? btrfs_ino(inode) : 0;
-               __entry->rootid         = inode ? inode->root->root_key.objectid : 0;
+               __entry->rootid         = inode ? btrfs_root_id(inode->root) : 0;
                __entry->start          = start;
                __entry->len            = len;
                __entry->clear_bits     = clear_bits;
 
                __entry->owner          = tree->owner;
                __entry->ino            = inode ? btrfs_ino(inode) : 0;
-               __entry->rootid         = inode ? inode->root->root_key.objectid : 0;
+               __entry->rootid         = inode ? btrfs_root_id(inode->root) : 0;
                __entry->start          = start;
                __entry->len            = len;
                __entry->set_bits       = set_bits;
 
        TP_fast_assign_btrfs(inode->root->fs_info,
                __entry->ino            = btrfs_ino(inode);
-               __entry->root_id        = inode->root->root_key.objectid;
+               __entry->root_id        = btrfs_root_id(inode->root);
                __entry->start          = em->start;
                __entry->len            = em->len;
                __entry->flags          = em->flags;