diff options
| author | NeilBrown <neilb@suse.de> | 2025-03-19 06:01:36 +0300 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-04-08 12:24:41 +0300 |
| commit | 06c567403ae5a0b56005c2d4a184c903f572c844 (patch) | |
| tree | 2240053af127cf0a802a5b05e805c5bea4ec6daf /include/linux | |
| parent | fa6fe07d1536361a227d655e69ca270faf28fdbe (diff) | |
| download | linux-06c567403ae5a0b56005c2d4a184c903f572c844.tar.xz | |
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 'include/linux')
| -rw-r--r-- | include/linux/dcache.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index e974e63bcdbc..a324f82df562 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -288,7 +288,6 @@ extern void d_exchange(struct dentry *, struct dentry *); extern struct dentry *d_ancestor(struct dentry *, struct dentry *); extern struct dentry *d_lookup(const struct dentry *, const struct qstr *); -extern struct dentry *d_hash_and_lookup(struct dentry *, struct qstr *); static inline unsigned d_count(const struct dentry *dentry) { |
