Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Jeff Layton and committed by
Christian Brauner
46460c1d 45fab40d

+14
+14
fs/namei.c
··· 1639 1639 } 1640 1640 EXPORT_SYMBOL(lookup_one_qstr_excl); 1641 1641 1642 + /** 1643 + * lookup_fast - do fast lockless (but racy) lookup of a dentry 1644 + * @nd: current nameidata 1645 + * 1646 + * Do a fast, but racy lookup in the dcache for the given dentry, and 1647 + * revalidate it. Returns a valid dentry pointer or NULL if one wasn't 1648 + * found. On error, an ERR_PTR will be returned. 1649 + * 1650 + * If this function returns a valid dentry and the walk is no longer 1651 + * lazy, the dentry will carry a reference that must later be put. If 1652 + * RCU mode is still in force, then this is not the case and the dentry 1653 + * must be legitimized before use. If this returns NULL, then the walk 1654 + * will no longer be in RCU mode. 1655 + */ 1642 1656 static struct dentry *lookup_fast(struct nameidata *nd) 1643 1657 { 1644 1658 struct dentry *dentry, *parent = nd->path.dentry;