Skip to contentSkip to conversation

erofs: drop unnecessary .read_folio() checks for file-backed mounts

PATCH New Gao Xiang 1 participant 1 message Oct 27 EROFS file system

lore
Share & tools
lore

Gao Xiang

author maintainer
#0 lore raw

PATCH 1/1 erofs: drop unnecessary .read_folio() checks for file-backed mounts

Since currently dedicated EROFS-owned meta inodes are used for file-backed mounts, .read_folio() checks are now redundant.

As a result, EROFS file-back mounts can now apply to tmpfs too.

Fixes e587a984d332 ("erofs: use dedicated meta inodes for file-backed mounts")
---
 fs/erofs/super.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/erofs/super.c +2 -4
index 16fa3b853f1b..254b32f77a42 100644
@@ -850,8 +850,7 @@ static int erofs_fc_get_tree(struct fs_context *fc)
 			errorfc(fc, "source fd option not supported");
 			return -EINVAL;
 		}
-		if (!S_ISREG(file_inode(sbi->dif0.file)->i_mode) ||
-		    !sbi->dif0.file->f_mapping->a_ops->read_folio) {
+		if (!S_ISREG(file_inode(sbi->dif0.file)->i_mode)) {
 			errorfc(fc, "source is unsupported");
 			return -EINVAL;
 		}
@@ -871,8 +870,7 @@ static int erofs_fc_get_tree(struct fs_context *fc)
 			return PTR_ERR(file);
 		sbi->dif0.file = file;
 
-		if (S_ISREG(file_inode(sbi->dif0.file)->i_mode) &&
-		    sbi->dif0.file->f_mapping->a_ops->read_folio)
+		if (S_ISREG(file_inode(sbi->dif0.file)->i_mode))
 			return erofs_file_get_tree(fc);
 	}
 	return ret;
Signature · 1 line
2.47.3