diff options
| author | Christian Brauner <brauner@kernel.org> | 2025-06-18 23:53:36 +0300 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-06-19 15:28:24 +0300 |
| commit | bda3f1608d993419fa247dc11263fc931ceca58a (patch) | |
| tree | dd125c788bb4a1b8b322d60ac6b0687ed5b5a452 /fs/internal.h | |
| parent | 1a1ad73aa1a66787f05f7f10f686b74bab77be72 (diff) | |
| download | linux-bda3f1608d993419fa247dc11263fc931ceca58a.tar.xz | |
libfs: massage path_from_stashed() to allow custom stashing behavior
* Add a callback to struct stashed_operations so it's possible to
implement custom behavior for pidfs and allow for it to return errors.
* Teach stashed_dentry_get() to handle error pointers.
Link: https://lore.kernel.org/20250618-work-pidfs-persistent-v2-2-98f3456fd552@kernel.org
Reviewed-by: Alexander Mikhalitsyn <aleksandr.mikhalitsyn@canonical.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/internal.h')
| -rw-r--r-- | fs/internal.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/internal.h b/fs/internal.h index 393f6c5c24f6..22ba066d1dba 100644 --- a/fs/internal.h +++ b/fs/internal.h @@ -322,12 +322,15 @@ 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 { + struct dentry *(*stash_dentry)(struct dentry **stashed, + struct dentry *dentry); void (*put_data)(void *data); int (*init_inode)(struct inode *inode, void *data); }; int path_from_stashed(struct dentry **stashed, struct vfsmount *mnt, void *data, struct path *path); void stashed_dentry_prune(struct dentry *dentry); +struct dentry *stash_dentry(struct dentry **stashed, struct dentry *dentry); struct dentry *stashed_dentry_get(struct dentry **stashed); /** * path_mounted - check whether path is mounted |
