mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:04:43 +01:00
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>
This commit is contained in:
parent
0bd20d8ee3
commit
3736449704
1 changed files with 1 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue