Message ID | 592f1b35af2c203e4bb6dd6431b6bb0c880e81aa.1740354271.git.wqu@suse.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | btrfs: make subpage handling be feature full | expand |
On Sun, Feb 23, 2025 at 11:47 PM Qu Wenruo <wqu@suse.com> wrote: > > Previously inline data extents creation is disable if the block size > (previously called sector size) is smaller than the page size, for the > following reasons: > > - Possible mixed inline and regular data extents > However this is also the same if the block size matches the page size, > thus we do not treat mixed inline and regular extents as an error. > > And the chance to cause mixed inline and regular data extents are not > even increased, it has the same requirement (compressed inline data > extent covering the whole first block, followed by regular extents). > > - Unable to handle async/inline delalloc range for block size < page > size cases > This is already fixed since commit 1d2fbb7f1f9e ("btrfs: allow > compression even if the range is not page aligned"). > > This was the major technical blockage, but it's no longer a blockage > anymore. > > With the major technical blockage already removed, we can enable inline > data extents creation no matter the block size nor the page size, > allowing the btrfs to have the same capacity for all block sizes. > > Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Filipe Manana <fdmanana@suse.com> Looks good, thanks. > --- > fs/btrfs/inode.c | 13 ------------- > 1 file changed, 13 deletions(-) > > diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c > index e99cb5109967..a1ea93bad80e 100644 > --- a/fs/btrfs/inode.c > +++ b/fs/btrfs/inode.c > @@ -566,19 +566,6 @@ static bool can_cow_file_range_inline(struct btrfs_inode *inode, > if (offset != 0) > return false; > > - /* > - * Due to the page size limit, for subpage we can only trigger the > - * writeback for the dirty sectors of page, that means data writeback > - * is doing more writeback than what we want. > - * > - * This is especially unexpected for some call sites like fallocate, > - * where we only increase i_size after everything is done. > - * This means we can trigger inline extent even if we didn't want to. > - * So here we skip inline extent creation completely. > - */ > - if (fs_info->sectorsize != PAGE_SIZE) > - return false; > - > /* Inline extents are limited to sectorsize. */ > if (size > fs_info->sectorsize) > return false; > -- > 2.48.1 > >
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index e99cb5109967..a1ea93bad80e 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -566,19 +566,6 @@ static bool can_cow_file_range_inline(struct btrfs_inode *inode, if (offset != 0) return false; - /* - * Due to the page size limit, for subpage we can only trigger the - * writeback for the dirty sectors of page, that means data writeback - * is doing more writeback than what we want. - * - * This is especially unexpected for some call sites like fallocate, - * where we only increase i_size after everything is done. - * This means we can trigger inline extent even if we didn't want to. - * So here we skip inline extent creation completely. - */ - if (fs_info->sectorsize != PAGE_SIZE) - return false; - /* Inline extents are limited to sectorsize. */ if (size > fs_info->sectorsize) return false;
Previously inline data extents creation is disable if the block size (previously called sector size) is smaller than the page size, for the following reasons: - Possible mixed inline and regular data extents However this is also the same if the block size matches the page size, thus we do not treat mixed inline and regular extents as an error. And the chance to cause mixed inline and regular data extents are not even increased, it has the same requirement (compressed inline data extent covering the whole first block, followed by regular extents). - Unable to handle async/inline delalloc range for block size < page size cases This is already fixed since commit 1d2fbb7f1f9e ("btrfs: allow compression even if the range is not page aligned"). This was the major technical blockage, but it's no longer a blockage anymore. With the major technical blockage already removed, we can enable inline data extents creation no matter the block size nor the page size, allowing the btrfs to have the same capacity for all block sizes. Signed-off-by: Qu Wenruo <wqu@suse.com> --- fs/btrfs/inode.c | 13 ------------- 1 file changed, 13 deletions(-)