}
btrfs_mark_buffer_dirty(eb);
printf("Added an extent item [%llu %u]\n", bytenr, node_size);
- btrfs_update_block_group(trans, extent_root, bytenr, node_size,
- 1, 0);
+ btrfs_update_block_group(extent_root, bytenr, node_size, 1, 0);
nrefs->refs[level] = 0;
nrefs->full_backref[level] =
u64 bytes = (found_key.type == BTRFS_EXTENT_ITEM_KEY) ?
found_key.offset : root->fs_info->nodesize;
- ret = btrfs_update_block_group(trans, root, bytenr,
+ ret = btrfs_update_block_group(root, bytenr,
bytes, 0, 0);
if (ret)
break;
}
btrfs_mark_buffer_dirty(leaf);
- ret = btrfs_update_block_group(trans, extent_root, rec->start,
+ ret = btrfs_update_block_group(extent_root, rec->start,
rec->max_size, 1, 0);
if (ret)
goto fail;
btrfs_set_extent_flags(eb, ei, BTRFS_EXTENT_FLAG_DATA);
btrfs_mark_buffer_dirty(eb);
- ret = btrfs_update_block_group(trans, extent_root, disk_bytenr,
+ ret = btrfs_update_block_group(extent_root, disk_bytenr,
num_bytes, 1, 0);
btrfs_release_path(&path);
}
u64 size);
int btrfs_make_block_groups(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info);
-int btrfs_update_block_group(struct btrfs_trans_handle *trans,
- struct btrfs_root *root, u64 bytenr, u64 num,
+int btrfs_update_block_group(struct btrfs_root *root, u64 bytenr, u64 num,
int alloc, int mark_free);
int btrfs_record_file_extent(struct btrfs_trans_handle *trans,
struct btrfs_root *root, u64 objectid,
return 0;
}
-static int update_block_group(struct btrfs_trans_handle *trans,
- struct btrfs_root *root,
+static int update_block_group(struct btrfs_root *root,
u64 bytenr, u64 num_bytes, int alloc,
int mark_free)
{
BUG_ON(ret);
}
- update_block_group(trans, root, bytenr, num_bytes, 0, mark_free);
+ update_block_group(root, bytenr, num_bytes, 0, mark_free);
}
fail:
btrfs_free_path(path);
btrfs_mark_buffer_dirty(leaf);
btrfs_free_path(path);
- ret = update_block_group(trans, root, ins->objectid, fs_info->nodesize,
+ ret = update_block_group(root, ins->objectid, fs_info->nodesize,
1, 0);
return ret;
}
return 0;
}
-int btrfs_update_block_group(struct btrfs_trans_handle *trans,
- struct btrfs_root *root,
+int btrfs_update_block_group(struct btrfs_root *root,
u64 bytenr, u64 num_bytes, int alloc,
int mark_free)
{
- return update_block_group(trans, root, bytenr, num_bytes,
+ return update_block_group(root, bytenr, num_bytes,
alloc, mark_free);
}
btrfs_item_key_to_cpu(leaf, &key, slot);
if (key.type == BTRFS_EXTENT_ITEM_KEY) {
bytes_used += key.offset;
- ret = btrfs_update_block_group(trans, root,
+ ret = btrfs_update_block_group(root,
key.objectid, key.offset, 1, 0);
BUG_ON(ret);
} else if (key.type == BTRFS_METADATA_ITEM_KEY) {
bytes_used += fs_info->nodesize;
- ret = btrfs_update_block_group(trans, root,
+ ret = btrfs_update_block_group(root,
key.objectid, fs_info->nodesize, 1, 0);
if (ret)
goto out;
BTRFS_EXTENT_FLAG_DATA);
btrfs_mark_buffer_dirty(leaf);
- ret = btrfs_update_block_group(trans, root, disk_bytenr,
+ ret = btrfs_update_block_group(root, disk_bytenr,
num_bytes, 1, 0);
if (ret)
goto fail;