diff mbox series

[v4,63/68] btrfs: file: make btrfs_fallocate() to use PAGE_SIZE as blocksize

Message ID 20201021062554.68132-64-wqu@suse.com
State New, archived
Headers show
Series btrfs: add basic rw support for subpage sector size | expand

Commit Message

Qu Wenruo Oct. 21, 2020, 6:25 a.m. UTC
In theory, we can still allow subpage sector size to be utilized in such
case, but since btrfs_truncate_block() now operates in page unit, we
should also change btrfs_fallocate() to honor PAGE_SIZE as blocksize.

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


diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 6e342c466fdf..f7122f71b791 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -3244,7 +3244,7 @@  static long btrfs_fallocate(struct file *file, int mode,
 	u64 locked_end;
 	u64 actual_end = 0;
 	struct extent_map *em;
-	int blocksize = btrfs_inode_sectorsize(inode);
+	int blocksize = PAGE_SIZE;
 	int ret;
 	alloc_start = round_down(offset, blocksize);
@@ -3401,7 +3401,7 @@  static long btrfs_fallocate(struct file *file, int mode,
 		if (!ret)
 			ret = btrfs_prealloc_file_range(inode, mode,
-					range->len, i_blocksize(inode),
+					range->len, blocksize,
 					offset + len, &alloc_hint);