mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 08:31:13 +00:00
btrfs: make btrfs_reloc_clone_csums take btrfs_inode
It really wants btrfs_inode and not a vfs inode. Signed-off-by: Nikolay Borisov <nborisov@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
c350437269
commit
7bfa953501
3 changed files with 7 additions and 7 deletions
|
@ -3430,7 +3430,7 @@ int btrfs_init_reloc_root(struct btrfs_trans_handle *trans,
|
||||||
int btrfs_update_reloc_root(struct btrfs_trans_handle *trans,
|
int btrfs_update_reloc_root(struct btrfs_trans_handle *trans,
|
||||||
struct btrfs_root *root);
|
struct btrfs_root *root);
|
||||||
int btrfs_recover_relocation(struct btrfs_root *root);
|
int btrfs_recover_relocation(struct btrfs_root *root);
|
||||||
int btrfs_reloc_clone_csums(struct inode *inode, u64 file_pos, u64 len);
|
int btrfs_reloc_clone_csums(struct btrfs_inode *inode, u64 file_pos, u64 len);
|
||||||
int btrfs_reloc_cow_block(struct btrfs_trans_handle *trans,
|
int btrfs_reloc_cow_block(struct btrfs_trans_handle *trans,
|
||||||
struct btrfs_root *root, struct extent_buffer *buf,
|
struct btrfs_root *root, struct extent_buffer *buf,
|
||||||
struct extent_buffer *cow);
|
struct extent_buffer *cow);
|
||||||
|
|
|
@ -1085,7 +1085,7 @@ static noinline int cow_file_range(struct inode *inode,
|
||||||
|
|
||||||
if (root->root_key.objectid ==
|
if (root->root_key.objectid ==
|
||||||
BTRFS_DATA_RELOC_TREE_OBJECTID) {
|
BTRFS_DATA_RELOC_TREE_OBJECTID) {
|
||||||
ret = btrfs_reloc_clone_csums(inode, start,
|
ret = btrfs_reloc_clone_csums(BTRFS_I(inode), start,
|
||||||
cur_alloc_size);
|
cur_alloc_size);
|
||||||
/*
|
/*
|
||||||
* Only drop cache here, and process as normal.
|
* Only drop cache here, and process as normal.
|
||||||
|
@ -1743,7 +1743,7 @@ out_check:
|
||||||
* extent_clear_unlock_delalloc() in error handler
|
* extent_clear_unlock_delalloc() in error handler
|
||||||
* from freeing metadata of created ordered extent.
|
* from freeing metadata of created ordered extent.
|
||||||
*/
|
*/
|
||||||
ret = btrfs_reloc_clone_csums(inode, cur_offset,
|
ret = btrfs_reloc_clone_csums(BTRFS_I(inode), cur_offset,
|
||||||
num_bytes);
|
num_bytes);
|
||||||
|
|
||||||
extent_clear_unlock_delalloc(inode, cur_offset,
|
extent_clear_unlock_delalloc(inode, cur_offset,
|
||||||
|
|
|
@ -3870,9 +3870,9 @@ out:
|
||||||
* cloning checksum properly handles the nodatasum extents.
|
* cloning checksum properly handles the nodatasum extents.
|
||||||
* it also saves CPU time to re-calculate the checksum.
|
* it also saves CPU time to re-calculate the checksum.
|
||||||
*/
|
*/
|
||||||
int btrfs_reloc_clone_csums(struct inode *inode, u64 file_pos, u64 len)
|
int btrfs_reloc_clone_csums(struct btrfs_inode *inode, u64 file_pos, u64 len)
|
||||||
{
|
{
|
||||||
struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
|
struct btrfs_fs_info *fs_info = inode->root->fs_info;
|
||||||
struct btrfs_ordered_sum *sums;
|
struct btrfs_ordered_sum *sums;
|
||||||
struct btrfs_ordered_extent *ordered;
|
struct btrfs_ordered_extent *ordered;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -3880,10 +3880,10 @@ int btrfs_reloc_clone_csums(struct inode *inode, u64 file_pos, u64 len)
|
||||||
u64 new_bytenr;
|
u64 new_bytenr;
|
||||||
LIST_HEAD(list);
|
LIST_HEAD(list);
|
||||||
|
|
||||||
ordered = btrfs_lookup_ordered_extent(BTRFS_I(inode), file_pos);
|
ordered = btrfs_lookup_ordered_extent(inode, file_pos);
|
||||||
BUG_ON(ordered->file_offset != file_pos || ordered->num_bytes != len);
|
BUG_ON(ordered->file_offset != file_pos || ordered->num_bytes != len);
|
||||||
|
|
||||||
disk_bytenr = file_pos + BTRFS_I(inode)->index_cnt;
|
disk_bytenr = file_pos + inode->index_cnt;
|
||||||
ret = btrfs_lookup_csums_range(fs_info->csum_root, disk_bytenr,
|
ret = btrfs_lookup_csums_range(fs_info->csum_root, disk_bytenr,
|
||||||
disk_bytenr + len - 1, &list, 0);
|
disk_bytenr + len - 1, &list, 0);
|
||||||
if (ret)
|
if (ret)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue