btrfs: rename btrfs_punch_hole_range() to a more generic name
The function btrfs_punch_hole_range() is now used to replace all the file extents in a given file range with an extent described in the given struct btrfs_replace_extent_info argument. This extent can either be an existing extent that is being cloned or it can be a new extent (namely a prealloc extent). When that argument is NULL it only punches a hole (drops all the existing extents) in the file range. So rename the function to btrfs_replace_file_extents(). Reviewed-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Filipe Manana <fdmanana@suse.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:

committed by
David Sterba

parent
bf385648fa
commit
306bfec02b
@@ -2659,7 +2659,7 @@ static int btrfs_insert_clone_extent(struct btrfs_trans_handle *trans,
|
||||
* extents without inserting a new one, so we must abort the transaction to avoid
|
||||
* a corruption.
|
||||
*/
|
||||
int btrfs_punch_hole_range(struct inode *inode, struct btrfs_path *path,
|
||||
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,
|
||||
struct btrfs_trans_handle **trans_out)
|
||||
@@ -3007,7 +3007,7 @@ static int btrfs_punch_hole(struct inode *inode, loff_t offset, loff_t len)
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = btrfs_punch_hole_range(inode, path, lockstart, lockend, NULL,
|
||||
ret = btrfs_replace_file_extents(inode, path, lockstart, lockend, NULL,
|
||||
&trans);
|
||||
btrfs_free_path(path);
|
||||
if (ret)
|
||||
|
Reference in New Issue
Block a user