diff mbox series

[RFCv3,3/7] ext2: Enable large folio support

Message ID 581b2ed21a709093522f3747c06e8171c82f2d8c.1714046808.git.ritesh.list@gmail.com (mailing list archive)
State New, archived
Headers show
Series ext2 iomap changes and iomap improvements | expand

Commit Message

Ritesh Harjani (IBM) April 25, 2024, 1:28 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

Darrick J. Wong April 26, 2024, 3:30 p.m. UTC | #1
On Thu, Apr 25, 2024 at 06:58:47PM +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.
> 
> Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>

This filesystem is looking more and more modern!
Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> ---
>  fs/ext2/inode.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
> index f90d280025d9..2b62786130b5 100644
> --- a/fs/ext2/inode.c
> +++ b/fs/ext2/inode.c
> @@ -1424,10 +1424,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)
> -- 
> 2.44.0
> 
>
diff mbox series

Patch

diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index f90d280025d9..2b62786130b5 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -1424,10 +1424,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)