mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
synced 2025-01-07 11:33:51 +08:00
btrfs-progs: mkfs: use the btrfs_block_group_root helper
Instead of accessing the extent root directory for modifying block groups, use the helper which will do the correct thing based on the flags of the file system. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
cab7570ccc
commit
360103e610
@ -9426,6 +9426,7 @@ static int reinit_global_roots(struct btrfs_trans_handle *trans, u64 objectid)
|
||||
|
||||
static int reinit_extent_tree(struct btrfs_trans_handle *trans, bool pin)
|
||||
{
|
||||
struct btrfs_root *bg_root = btrfs_block_group_root(trans->fs_info);
|
||||
u64 start = 0;
|
||||
int ret;
|
||||
|
||||
@ -9499,7 +9500,6 @@ again:
|
||||
while (1) {
|
||||
struct btrfs_block_group_item bgi;
|
||||
struct btrfs_block_group *cache;
|
||||
struct btrfs_root *extent_root = btrfs_extent_root(gfs_info, 0);
|
||||
struct btrfs_key key;
|
||||
|
||||
cache = btrfs_lookup_first_block_group(gfs_info, start);
|
||||
@ -9513,7 +9513,7 @@ again:
|
||||
key.objectid = cache->start;
|
||||
key.type = BTRFS_BLOCK_GROUP_ITEM_KEY;
|
||||
key.offset = cache->length;
|
||||
ret = btrfs_insert_item(trans, extent_root, &key, &bgi,
|
||||
ret = btrfs_insert_item(trans, bg_root, &key, &bgi,
|
||||
sizeof(bgi));
|
||||
if (ret) {
|
||||
fprintf(stderr, "Error adding block group\n");
|
||||
|
@ -596,7 +596,7 @@ static int cleanup_temp_chunks(struct btrfs_fs_info *fs_info,
|
||||
{
|
||||
struct btrfs_trans_handle *trans = NULL;
|
||||
struct btrfs_block_group_item *bgi;
|
||||
struct btrfs_root *root = btrfs_extent_root(fs_info, 0);
|
||||
struct btrfs_root *root = btrfs_block_group_root(fs_info);
|
||||
struct btrfs_key key;
|
||||
struct btrfs_key found_key;
|
||||
struct btrfs_path path;
|
||||
|
Loading…
Reference in New Issue
Block a user