diff mbox series

[2/2] btrfs: allow inline data extents creation if sector size < page size

Message ID 4df35fbb829dfbcf64a914e5c8f652d9a3ad5227.1731650263.git.wqu@suse.com (mailing list archive)
State New
Headers show
Series btrfs: allow creating inline data extents for sector size < page size case | expand

Commit Message

Qu Wenruo Nov. 15, 2024, 6:03 a.m. UTC
Previously inline data extents creation is disable if sector size < page
size, as there are two blockage:

- Possible mixed inline and regular data extents
  However this is also the case for sector size < page size cases, thus
  we do not treat mixed inline and regular extents as an error.
  So from day one, more mixed inline and regular extents are not a
  strong argument to disable inline extents.

- Unable to handle async/inline delalloc range for sector size < page
  size cases
  This is fixed with the recent sector perfect compressed write support
  for sector size < page size cases.
  And this is the main technical blockage.

With the major technical blockage already removed, we can enable inline
data extents creation for sector size < page size, allowing the btrfs to
have the same capacity no matter the page size.

Signed-off-by: Qu Wenruo <wqu@suse.com>
---
 fs/btrfs/inode.c | 13 -------------
 1 file changed, 13 deletions(-)
diff mbox series

Patch

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index a0599369ca0c..712157ecda08 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -605,19 +605,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;