@@ -3100,8 +3100,8 @@ int __btrfs_drop_extents(struct btrfs_trans_handle *trans,
u32 extent_item_size,
int *key_inserted);
int btrfs_drop_extents(struct btrfs_trans_handle *trans,
- struct btrfs_root *root, struct inode *inode, u64 start,
- u64 end, int drop_cache);
+ struct btrfs_root *root, struct btrfs_inode *inode,
+ u64 start, u64 end, int drop_cache);
int btrfs_replace_file_extents(struct inode *inode, struct btrfs_path *path,
const u64 start, const u64 end,
struct btrfs_replace_extent_info *extent_info,
@@ -1075,8 +1075,8 @@ int __btrfs_drop_extents(struct btrfs_trans_handle *trans,
}
int btrfs_drop_extents(struct btrfs_trans_handle *trans,
- struct btrfs_root *root, struct inode *inode, u64 start,
- u64 end, int drop_cache)
+ struct btrfs_root *root, struct btrfs_inode *inode,
+ u64 start, u64 end, int drop_cache)
{
struct btrfs_path *path;
int ret;
@@ -1084,8 +1084,8 @@ int btrfs_drop_extents(struct btrfs_trans_handle *trans,
path = btrfs_alloc_path();
if (!path)
return -ENOMEM;
- ret = __btrfs_drop_extents(trans, root, BTRFS_I(inode), path, start,
- end, NULL, drop_cache, 0, 0, NULL);
+ ret = __btrfs_drop_extents(trans, root, inode, path, start, end, NULL,
+ drop_cache, 0, 0, NULL);
btrfs_free_path(path);
return ret;
}
@@ -4649,8 +4649,7 @@ static int maybe_insert_hole(struct btrfs_root *root, struct btrfs_inode *inode,
if (IS_ERR(trans))
return PTR_ERR(trans);
- ret = btrfs_drop_extents(trans, root, &inode->vfs_inode, offset,
- offset + len, 1);
+ ret = btrfs_drop_extents(trans, root, inode, offset, offset + len, 1);
if (ret) {
btrfs_abort_transaction(trans, ret);
btrfs_end_transaction(trans);
@@ -252,7 +252,8 @@ static int clone_copy_inline_extent(struct inode *dst,
trans = NULL;
goto out;
}
- ret = btrfs_drop_extents(trans, root, dst, drop_start, aligned_end, 1);
+ ret = btrfs_drop_extents(trans, root, BTRFS_I(dst), drop_start,
+ aligned_end, 1);
if (ret)
goto out;
ret = btrfs_insert_empty_item(trans, root, path, new_key, size);
@@ -653,7 +653,8 @@ static noinline int replay_one_extent(struct btrfs_trans_handle *trans,
btrfs_release_path(path);
/* drop any overlapping extents */
- ret = btrfs_drop_extents(trans, root, inode, start, extent_end, 1);
+ ret = btrfs_drop_extents(trans, root, BTRFS_I(inode), start, extent_end,
+ 1);
if (ret)
goto out;
@@ -2586,7 +2587,8 @@ static int replay_one_buffer(struct btrfs_root *log, struct extent_buffer *eb,
}
from = ALIGN(i_size_read(inode),
root->fs_info->sectorsize);
- ret = btrfs_drop_extents(wc->trans, root, inode,
+ ret = btrfs_drop_extents(wc->trans, root,
+ BTRFS_I(inode),
from, (u64)-1, 1);
if (!ret) {
/* Update the inode's nbytes. */
Signed-off-by: Nikolay Borisov <nborisov@suse.com> --- fs/btrfs/ctree.h | 4 ++-- fs/btrfs/file.c | 8 ++++---- fs/btrfs/inode.c | 3 +-- fs/btrfs/reflink.c | 3 ++- fs/btrfs/tree-log.c | 6 ++++-- 5 files changed, 13 insertions(+), 11 deletions(-)