d_ancestor(9)
π d_ancestor(9) β the kernel API manual, bestie edition
okay so real talk, this page lives in the Kernel API Manual and it's about one tiny function that answers a very specific question: is this dentry an ancestor of that dentry, and if so which one do i hand back? that's the whole vibe. let's get into it π«Ά
β¨ NAME β¨
d_ancestor β search for an ancestor, no cap π
πΈ SYNOPSIS πΈ
struct dentry * d_ancestor (struct dentry *p1 , struct dentry *p2 );
that's it. two pointers in, one pointer out. iconic signature tbh π
π ARGUMENTS π
p1β the ancestor dentry π (the one that might be the parent-ish one)p2β the child dentry π (the one we're checking on)
π¦ DESCRIPTION π¦
so here's the tea β β this function returns the ancestor dentry of p2 which is a child of p1, if p1 is an ancestor of p2. otherwise? it gives you NULL. literally that simple. not me explaining this in one sentence π
lowkey the whole function is a conditional. no side quests, no hidden options, just vibes and a pointer (or NULL). β¨
π SEE ALSO π
bestie we are NOT done, there is a whole friend group π the kernel file is ./fs/dcache.c and here's everybody else you should go say hi to:
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)d_walk(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_splice_alias(9)is_subdir(9)
like. that's the entire dcache extended universe, go read them all, i'll wait π§π
okay that's the page!! it's from ./fs, dated October 2026, and yeah the page itself is d_ancestor(9) β mwah, slay, periodt ππβ¨
π¦ 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