[f2fs-dev] [RFC PATCH 8/9] f2fs: allow large folio support to writeable files

Nanzhe Zhao via Linux-f2fs-devel <[email protected]>
Newsgroups net.sourceforge.lists.linux-f2fs-devel
Message-ID <[email protected]>
From: Nanzhe <[email protected]>

Now we make all write path support large folios,
so we open permission to let writeable file set
large folio mapping.

Signed-off-by: Nanzhe <[email protected]>
---
 fs/f2fs/file.c  | 14 --------------
 fs/f2fs/inode.c |  6 ++----
 2 files changed, 2 insertions(+), 18 deletions(-)

diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index c1b3c9d1ab92..bf5497aad1a7 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -87,17 +87,6 @@ static vm_fault_t f2fs_vm_page_mkwrite(struct vm_fault *vmf)
 	int err = 0;
 	vm_fault_t ret;
 
-	/*
-	 * We only support large folio on the read case.
-	 * Don't make any dirty pages.
-	 */
-	if (unlikely(IS_IMMUTABLE(inode)) ||
-	    mapping_large_folio_support(inode->i_mapping)) {
-		f2fs_err(sbi, "Not expected: immutable: %d large_folio: %d",
-				IS_IMMUTABLE(inode),
-				mapping_large_folio_support(inode->i_mapping));
-		return VM_FAULT_SIGBUS;
-	}
 
 	if (is_inode_flag_set(inode, FI_COMPRESS_RELEASED)) {
 		err = -EIO;
@@ -650,9 +639,6 @@ static int f2fs_file_open(struct inode *inode, struct file *filp)
 	if (!f2fs_is_compress_backend_ready(inode))
 		return -EOPNOTSUPP;
 
-	if (mapping_large_folio_support(inode->i_mapping) &&
-	    filp->f_mode & FMODE_WRITE)
-		return -EOPNOTSUPP;
 
 	err = fsverity_file_open(inode, filp);
 	if (err)
diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c
index e30f9a2c18b9..2f1ddcaaf5d3 100644
--- a/fs/f2fs/inode.c
+++ b/fs/f2fs/inode.c
@@ -581,10 +581,8 @@ static void f2fs_mapping_set_large_folio(struct inode *inode)
 		return;
 	if (f2fs_quota_file(sbi, inode->i_ino))
 		return;
-	if (IS_IMMUTABLE(inode) ||
-	    (f2fs_exist_written_data(sbi, inode->i_ino, LARGE_FOLIO_INO) &&
-	     !(inode->i_mode & S_IWUGO)))
-	    mapping_set_folio_min_order(inode->i_mapping, 0);
+
+	mapping_set_folio_min_order(inode->i_mapping, 0);
 }
 
 struct inode *f2fs_iget(struct super_block *sb, unsigned long ino)
-- 
2.34.1



_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.