diff options
author | Miklos Szeredi <mszeredi@redhat.com> | 2022-09-24 08:00:00 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@redhat.com> | 2022-09-24 08:00:00 +0300 |
commit | 863f144f12add1f4eab80b70561a90857c524a8b (patch) | |
tree | e537ccaee9ef0a552e610024357cfa5ad53b5516 /fs/dcache.c | |
parent | 9751b338656f05a0ce918befd5118fcd970c71c6 (diff) | |
download | linux-863f144f12add1f4eab80b70561a90857c524a8b.tar.xz |
vfs: open inside ->tmpfile()
This is in preparation for adding tmpfile support to fuse, which requires
that the tmpfile creation and opening are done as a single operation.
Replace the 'struct dentry *' argument of i_op->tmpfile with
'struct file *'.
Call finish_open_simple() as the last thing in ->tmpfile() instances (may
be omitted in the error case).
Change d_tmpfile() argument to 'struct file *' as well to make callers more
readable.
Reviewed-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
Diffstat (limited to 'fs/dcache.c')
-rw-r--r-- | fs/dcache.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/dcache.c b/fs/dcache.c index bb0c4d0038db..89dc61389102 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -3258,8 +3258,10 @@ void d_genocide(struct dentry *parent) EXPORT_SYMBOL(d_genocide); -void d_tmpfile(struct dentry *dentry, struct inode *inode) +void d_tmpfile(struct file *file, struct inode *inode) { + struct dentry *dentry = file->f_path.dentry; + inode_dec_link_count(inode); BUG_ON(dentry->d_name.name != dentry->d_iname || !hlist_unhashed(&dentry->d_u.d_alias) || |