diff options
author | Christian Brauner <brauner@kernel.org> | 2024-02-21 09:59:51 +0100 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-03-01 12:26:29 +0100 |
commit | 2558e3b23112adb82a558bab616890a790a38bc6 (patch) | |
tree | 89ce523bb85eab34592d8d859469858e90f9ef8f /fs/internal.h | |
parent | libfs: improve path_from_stashed() helper (diff) | |
download | linux-2558e3b23112adb82a558bab616890a790a38bc6.tar.xz linux-2558e3b23112adb82a558bab616890a790a38bc6.zip |
libfs: add stashed_dentry_prune()
Both pidfs and nsfs use a memory location to stash a dentry for reuse by
concurrent openers. Right now two custom
dentry->d_prune::{ns,pidfs}_prune_dentry() methods are needed that do
the same thing. The only thing that differs is that they need to get to
the memory location to store or retrieve the dentry from differently.
Fix that by remember the stashing location for the dentry in
dentry->d_fsdata which allows us to retrieve it in dentry->d_prune. That
in turn makes it possible to add a common helper that pidfs and nsfs can
both use.
Link: https://lore.kernel.org/r/CAHk-=wg8cHY=i3m6RnXQ2Y2W8psicKWQEZq1=94ivUiviM-0OA@mail.gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/internal.h')
-rw-r--r-- | fs/internal.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/internal.h b/fs/internal.h index a34531bcad6e..b0c843c3fa3c 100644 --- a/fs/internal.h +++ b/fs/internal.h @@ -314,3 +314,4 @@ 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); +void stashed_dentry_prune(struct dentry *dentry); |