diff options
author | Jeff Layton <jlayton@kernel.org> | 2024-08-02 17:45:03 -0400 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2024-08-30 08:22:33 +0200 |
commit | 46460c1d42e823842db8b529156069187d566c83 (patch) | |
tree | 504d952321bc4301e28fb8f29b9bf5462513d412 /fs/namei.c | |
parent | 45fab40d34650fad9ddbaeaed1a89997d7736ea0 (diff) |
fs: add a kerneldoc header over lookup_fast
The lookup_fast helper in fs/namei.c has some subtlety in how dentries
are returned. Document them.
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://lore.kernel.org/r/20240802-openfast-v1-2-a1cff2a33063@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/namei.c')
-rw-r--r-- | fs/namei.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/namei.c b/fs/namei.c index 5512cb10fa89..c3459785704d 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1639,6 +1639,20 @@ struct dentry *lookup_one_qstr_excl(const struct qstr *name, } EXPORT_SYMBOL(lookup_one_qstr_excl); +/** + * lookup_fast - do fast lockless (but racy) lookup of a dentry + * @nd: current nameidata + * + * Do a fast, but racy lookup in the dcache for the given dentry, and + * revalidate it. Returns a valid dentry pointer or NULL if one wasn't + * found. On error, an ERR_PTR will be returned. + * + * If this function returns a valid dentry and the walk is no longer + * lazy, the dentry will carry a reference that must later be put. If + * RCU mode is still in force, then this is not the case and the dentry + * must be legitimized before use. If this returns NULL, then the walk + * will no longer be in RCU mode. + */ static struct dentry *lookup_fast(struct nameidata *nd) { struct dentry *dentry, *parent = nd->path.dentry; |