diff mbox series

[RFC,3/3] ext2: Enable large folio support

Message ID 3dd8b8bce2c29d5e87bbdc9e37fa11ba80f184b9.1700506526.git.ritesh.list@gmail.com (mailing list archive)
State New
Headers show
Series ext2: Use iomap in buffered-io for regular files and enable large folio support | expand

Commit Message

Ritesh Harjani (IBM) Nov. 20, 2023, 7:05 p.m. UTC
Now that ext2 regular file buffered-io path is converted to use iomap,
we can also enable large folio support for ext2.

Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
---
 fs/ext2/inode.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Matthew Wilcox Nov. 20, 2023, 8 p.m. UTC | #1
On Tue, Nov 21, 2023 at 12:35:21AM +0530, Ritesh Harjani (IBM) wrote:
> Now that ext2 regular file buffered-io path is converted to use iomap,
> we can also enable large folio support for ext2.

Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>
diff mbox series

Patch

diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index b6224d94a7dd..ad04da5ed6bd 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -1425,10 +1425,12 @@  void ext2_set_file_ops(struct inode *inode)
 {
 	inode->i_op = &ext2_file_inode_operations;
 	inode->i_fop = &ext2_file_operations;
-	if (IS_DAX(inode))
+	if (IS_DAX(inode)) {
 		inode->i_mapping->a_ops = &ext2_dax_aops;
-	else
+	} else {
 		inode->i_mapping->a_ops = &ext2_file_aops;
+		mapping_set_large_folios(inode->i_mapping);
+	}
 }
 
 struct inode *ext2_iget (struct super_block *sb, unsigned long ino)