On Mon, Dec 30, 2019 at 04:31:15PM -0500, Josef Bacik wrote:
> +int btrfs_inode_set_file_extent_range(struct btrfs_inode *inode, u64 start,
> + u64 len)
> +{
> + if (len == 0)
> + return 0;
> +
> + ASSERT(IS_ALIGNED(start + len, inode->root->fs_info->sectorsize));
> +
> + if (btrfs_fs_incompat(inode->root->fs_info, NO_HOLES))
> + return 0;
> + return set_extent_bits(&inode->file_extent_tree, start, start + len - 1,
> + EXTENT_DIRTY);
set_extent_bits and friends do the allocations for range splits so this
is going to decrease performance. For the allocations and tree
traversals. With enabled no-holes it's not going to be a problem, but
there are still many filesystems without the feature enabled so this
needs some evaluation.