btrfs-progs: make sure track_dirty and ref_cows is set properly

Adding support for the per-block group roots means we will be reading
the roots directly in different places.  Make sure we set ->track_dirty
and ->ref_cows properly in the helper so we don't have to do this
everywhere.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
Josef Bacik 2021-08-23 16:14:51 -04:00 committed by David Sterba
parent 41c3fa5d0b
commit 3d870a491f

View File

@ -705,7 +705,10 @@ out:
return ERR_PTR(-EIO);
}
insert:
root->ref_cows = 1;
if (root->root_key.objectid != BTRFS_TREE_LOG_OBJECTID)
root->track_dirty = 1;
if (is_fstree(root->root_key.objectid))
root->ref_cows = 1;
return root;
}