btrfs: don't use extent_root in iterate_extent_inodes
authorJosef Bacik <josef@toxicpanda.com>
Fri, 5 Nov 2021 20:45:42 +0000 (16:45 -0400)
committerDavid Sterba <dsterba@suse.com>
Mon, 3 Jan 2022 14:09:48 +0000 (15:09 +0100)
We are going to have many extent_roots soon, and we don't need a root
here necessarily as we're not modifying anything, we're just getting the
trans handle so we can have an accurate view of references, so use the
tree_root here.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/backref.c

index c6320c4..b51f8f9 100644 (file)
@@ -1969,7 +1969,7 @@ int iterate_extent_inodes(struct btrfs_fs_info *fs_info,
                        extent_item_objectid);
 
        if (!search_commit_root) {
-               trans = btrfs_attach_transaction(fs_info->extent_root);
+               trans = btrfs_attach_transaction(fs_info->tree_root);
                if (IS_ERR(trans)) {
                        if (PTR_ERR(trans) != -ENOENT &&
                            PTR_ERR(trans) != -EROFS)