aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/fs/internal.h
diff options
context:
space:
mode:
authorChristian Brauner <brauner@kernel.org>2024-03-01 10:26:03 +0100
committerChristian Brauner <brauner@kernel.org>2024-03-01 22:31:40 +0100
commite9c5263ce16d96311c118111ac779f004be8b473 (patch)
tree4657444a1bb7f15a4a52e5991a2673b80206c7ad /fs/internal.h
parentlibfs: add stashed_dentry_prune() (diff)
downloadwireguard-linux-e9c5263ce16d96311c118111ac779f004be8b473.tar.xz
wireguard-linux-e9c5263ce16d96311c118111ac779f004be8b473.zip
libfs: improve path_from_stashed()
Right now we pass a bunch of info that is fs specific which doesn't make a lot of sense and it bleeds fs sepcific details into the generic helper. nsfs and pidfs have slightly different needs when initializing inodes. Add simple operations that are stashed in sb->s_fs_info that both can implement. This also allows us to get rid of cleaning up references in the caller. All in all path_from_stashed() becomes way simpler. Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/internal.h')
-rw-r--r--fs/internal.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/internal.h b/fs/internal.h
index b0c843c3fa3c..7d3edcdf59cc 100644
--- a/fs/internal.h
+++ b/fs/internal.h
@@ -310,8 +310,10 @@ ssize_t __kernel_write_iter(struct file *file, struct iov_iter *from, loff_t *po
struct mnt_idmap *alloc_mnt_idmap(struct user_namespace *mnt_userns);
struct mnt_idmap *mnt_idmap_get(struct mnt_idmap *idmap);
void mnt_idmap_put(struct mnt_idmap *idmap);
+struct stashed_operations {
+ void (*put_data)(void *data);
+ void (*init_inode)(struct inode *inode, void *data);
+};
int path_from_stashed(struct dentry **stashed, unsigned long ino,
- struct vfsmount *mnt, const struct file_operations *fops,
- const struct inode_operations *iops, void *data,
- struct path *path);
+ struct vfsmount *mnt, void *data, struct path *path);
void stashed_dentry_prune(struct dentry *dentry);