fsync(eb->fd);
}
- num_copies = btrfs_num_copies(&root->fs_info->mapping_tree,
- eb->start, eb->len);
+ num_copies = btrfs_num_copies(root->fs_info, eb->start,
+ eb->len);
if (num_copies == 1)
break;
{
struct extent_buffer *eb;
- eb = read_tree_block(fs_info, bytenr, fs_info->nodesize, 0);
+ eb = read_tree_block(fs_info, bytenr, 0);
if (!extent_buffer_uptodate(eb))
return -EIO;;
struct extent_buffer *next;
next = read_tree_block(fs_info, btrfs_node_blockptr(eb, i),
- fs_info->nodesize,
btrfs_node_ptr_generation(eb, i));
if (!extent_buffer_uptodate(next))
continue;
return -EINVAL;
}
- eb = read_tree_block(fs_info, block, fs_info->nodesize, 0);
+ eb = read_tree_block(fs_info, block, 0);
if (!extent_buffer_uptodate(eb)) {
fprintf(stderr, "Couldn't read in tree block %s\n", field);
return -EINVAL;
if (logical == (u64)-1)
print_usage(1);
trans = btrfs_start_transaction(root, 1);
+ BUG_ON(IS_ERR(trans));
ret = corrupt_extent(trans, root, logical);
btrfs_commit_transaction(trans, root);
goto out_close;
}
if (extent_tree) {
struct btrfs_trans_handle *trans;
+
trans = btrfs_start_transaction(root, 1);
+ BUG_ON(IS_ERR(trans));
btrfs_corrupt_extent_tree(trans, root->fs_info->extent_root,
root->fs_info->extent_root->node);
btrfs_commit_transaction(trans, root);
goto out_close;
}
trans = btrfs_start_transaction(root, 1);
+ BUG_ON(IS_ERR(trans));
ret = corrupt_item_nocow(trans, root->fs_info->chunk_root,
path, del);
if (ret < 0)
}
if (chunk_tree) {
struct btrfs_trans_handle *trans;
+
trans = btrfs_start_transaction(root, 1);
+ BUG_ON(IS_ERR(trans));
ret = corrupt_chunk_tree(trans, root->fs_info->chunk_root);
if (ret < 0)
fprintf(stderr, "Failed to corrupt chunk tree\n");
print_usage(1);
trans = btrfs_start_transaction(root, 1);
+ BUG_ON(IS_ERR(trans));
if (file_extent == (u64)-1) {
printf("corrupting inode\n");
ret = corrupt_inode(trans, root, inode, field);
struct extent_buffer *eb;
eb = btrfs_find_create_tree_block(root->fs_info,
- logical, root->fs_info->sectorsize);
+ logical);
if (!eb) {
error(
"not enough memory to allocate extent buffer for bytenr %llu",