[Concept,07/21] linux: fs: Add shared VFS function declarations

Message ID 20260416165733.2923423-8-sjg@u-boot.org
State New
Headers
Series fs: Add ISO 9660 filesystem driver ported from Linux |

Commit Message

Simon Glass April 16, 2026, 4:56 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

Declare the common VFS helpers shared across Linux-ported filesystem
drivers: dir_emit_dot(), dir_emit_dotdot(), generic_ro_fops and
page_symlink_inode_operations.

Update the source-file comments on generic_read_dir() and
generic_check_addressable() to point at fs/linux_fs.c, where the
implementations move in a follow-up patch.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 include/linux/fs.h | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
  

Patch

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 1bc50d46281..c8b95528013 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -472,6 +472,10 @@  static inline bool dir_emit(struct dir_context *ctx, const char *name, int len,
 	return ctx->actor(ctx, name, len, ctx->pos, ino, type) == 0;
 }
 
+/* dir_emit_dot/dotdot - implemented in fs/linux_fs.c */
+bool dir_emit_dot(struct file *file, struct dir_context *ctx);
+bool dir_emit_dotdot(struct file *file, struct dir_context *ctx);
+
 #define dir_relax_shared(i)	({ (void)(i); 1; })
 
 /* Inode mutex nesting classes */
@@ -729,11 +733,17 @@  struct inode_operations {
 /* Case-insensitive name validation - not supported */
 #define generic_ci_validate_strict_name(d, n)	({ (void)(d); (void)(n); 1; })
 
-/* Generic directory read - implemented in ext4l/stub.c */
+/* Generic directory read - implemented in fs/linux_fs.c */
 ssize_t generic_read_dir(struct file *f, char __user *buf, size_t count,
 			 loff_t *ppos);
 
-/* Block addressability check - implemented in ext4l/stub.c */
+/* Block addressability check - implemented in fs/linux_fs.c */
 int generic_check_addressable(unsigned int blocksize_bits, u64 num_blocks);
 
+/* Read-only file operations stub - implemented in fs/linux_fs.c */
+extern const struct file_operations generic_ro_fops;
+
+/* Symlink inode operations stub - implemented in fs/linux_fs.c */
+extern const struct inode_operations page_symlink_inode_operations;
+
 #endif /* _LINUX_FS_H */