From 37364497048c5081d3bfa424638cc91a7a7644e2 Mon Sep 17 00:00:00 2001 From: Hongbo Li Date: Fri, 23 Jan 2026 01:31:23 +0000 Subject: [PATCH] fs: Export alloc_empty_backing_file There is no need to open nonexistent real files if backing files couldn't be backed by real files (e.g., EROFS page cache sharing doesn't need typical real files to open again). Therefore, we export the alloc_empty_backing_file() helper, allowing filesystems to dynamically set the backing file without real file open. This is particularly useful for obtaining the correct @path and @inode when calling file_user_path() and file_user_inode(). Signed-off-by: Hongbo Li Reviewed-by: Gao Xiang Acked-by: Amir Goldstein Acked-by: Christian Brauner Signed-off-by: Gao Xiang --- fs/file_table.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/file_table.c b/fs/file_table.c index cd4a3db4659ac..476edfe7d8f52 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -308,6 +308,7 @@ struct file *alloc_empty_backing_file(int flags, const struct cred *cred) ff->file.f_mode |= FMODE_BACKING | FMODE_NOACCOUNT; return &ff->file; } +EXPORT_SYMBOL_GPL(alloc_empty_backing_file); /** * file_init_path - initialize a 'struct file' based on path -- 2.47.3