static int log_extent_csums(struct btrfs_trans_handle *trans,
struct btrfs_inode *inode,
- struct btrfs_root *root,
+ struct btrfs_root *log_root,
const struct extent_map *em)
{
- struct btrfs_fs_info *fs_info = root->fs_info;
- struct btrfs_root *log = root->log_root;
u64 csum_offset;
u64 csum_len;
LIST_HEAD(ordered_sums);
}
/* block start is already adjusted for the file extent offset. */
- ret = btrfs_lookup_csums_range(fs_info->csum_root,
+ ret = btrfs_lookup_csums_range(trans->fs_info->csum_root,
em->block_start + csum_offset,
em->block_start + csum_offset +
csum_len - 1, &ordered_sums, 0);
struct btrfs_ordered_sum,
list);
if (!ret)
- ret = btrfs_csum_file_blocks(trans, log, sums);
+ ret = btrfs_csum_file_blocks(trans, log_root, sums);
list_del(&sums->list);
kfree(sums);
}
int ret;
int extent_inserted = 0;
- ret = log_extent_csums(trans, inode, root, em);
+ ret = log_extent_csums(trans, inode, log, em);
if (ret)
return ret;