summaryrefslogtreecommitdiff
path: root/fs/internal.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2025-03-19 14:01:36 +1100
committerChristian Brauner <brauner@kernel.org>2025-04-08 11:24:41 +0200
commit06c567403ae5a0b56005c2d4a184c903f572c844 (patch)
tree2240053af127cf0a802a5b05e805c5bea4ec6daf /fs/internal.h
parentfa6fe07d1536361a227d655e69ca270faf28fdbe (diff)
Use try_lookup_noperm() instead of d_hash_and_lookup() outside of VFS
try_lookup_noperm() and d_hash_and_lookup() are nearly identical. The former does some validation of the name where the latter doesn't. Outside of the VFS that validation is likely valuable, and having only one exported function for this task is certainly a good idea. So make d_hash_and_lookup() local to VFS files and change all other callers to try_lookup_noperm(). Note that the arguments are swapped. Signed-off-by: NeilBrown <neilb@suse.de> Link: https://lore.kernel.org/r/20250319031545.2999807-6-neil@brown.name Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/internal.h')
-rw-r--r--fs/internal.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/internal.h b/fs/internal.h
index b9b3e29a73fd..213bf3226213 100644
--- a/fs/internal.h
+++ b/fs/internal.h
@@ -66,6 +66,7 @@ int do_linkat(int olddfd, struct filename *old, int newdfd,
int vfs_tmpfile(struct mnt_idmap *idmap,
const struct path *parentpath,
struct file *file, umode_t mode);
+struct dentry *d_hash_and_lookup(struct dentry *, struct qstr *);
/*
* namespace.c