Skip to content

Commit 3736449

Browse files
Hongbo Lihsiangkao
authored andcommitted
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 <lihongbo22@huawei.com> Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Acked-by: Amir Goldstein <amir73il@gmail.com> Acked-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
1 parent 0bd20d8 commit 3736449

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

fs/file_table.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ struct file *alloc_empty_backing_file(int flags, const struct cred *cred)
308308
ff->file.f_mode |= FMODE_BACKING | FMODE_NOACCOUNT;
309309
return &ff->file;
310310
}
311+
EXPORT_SYMBOL_GPL(alloc_empty_backing_file);
311312

312313
/**
313314
* file_init_path - initialize a 'struct file' based on path

0 commit comments

Comments
 (0)