d_walk(9)
π d_walk(9) β bestie's guide to walking the dentry tree π¦
okay so this is from the Kernel API Manual, section 9, and it's literally called d_walk β yes it walks the dentry tree, the name ate and left no crumbs π
β¨ SYNOPSIS β¨
void d_walk (struct dentry *parent , void *data , enum d_walk_ret
(*enter)(void *, struct dentry *) );
no cap, that's the whole signature β a parent dentry, your data blob, and an enter callback. that's it, that's the vibe π
πΈ ARGUMENTS πΈ
parentβ where the walk starts. the starting point, the main character, the origin story π«Άdataβ the data that gets passed along toenterand tofinish. it makes the whole journey with you, no leaving anyone behind πenterβ the callback that fires when you first enter the dentry. first impressions matter, bestie β¨
π DESCRIPTION π
ngl the description is short and iconic: the enter callbacks are called with d_lock held. π₯
likeβ¦ that's the whole thing. d_lock is held when your enter callback runs. noted, memorized, tattooed, periodt. π
real talk: since it's held for you, don't go doing anything cursed in there β the manpage doesn't elaborate, so i'm not gonna invent lore. just know the lock is held, iykyk.
π SEE ALSO π
here's the whole friend group, all from the Kernel file ./fs/dcache.c β every single one, in order, because i don't do half-finished playlists π
d_drop(9)dentry_kill(9)__move_to_shrink_list(9)d_find_any_alias(9)d_find_alias(9)prune_dcache_sb(9)shrink_dcache_sb(9)enum d_walk_ret(9)path_has_submounts(9)shrink_dcache_tree(9)d_invalidate(9)__d_alloc(9)d_alloc(9)d_alloc_pseudo(9)d_instantiate(9)d_obtain_alias(9)d_obtain_root(9)d_add_ci(9)d_same_name(9)__d_lookup_rcu(9)d_lookup(9)__d_lookup(9)d_hash_and_lookup(9)d_delete(9)d_rehash(9)d_add(9)d_ancestor(9)d_splice_alias(9)is_subdir(9)
the way that's a whole squad π go read enum d_walk_ret(9) first tho, it's giving prerequisites π§
π SIGN-OFF π
this lil page lives in ./fs, and it's dated October 2026 β go off, future girlies π
β¨
stay locked, stay walked, and don't forget the d_lock bestie ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms