is_subdir(9)
π¦ is_subdir(9) β Kernel API Manual, but make it cute π¦
πΈ NAME πΈ
is_subdir β is new dentry a subdirectory of old_dentry? That's the whole question, bestie. π΅οΈββοΈ
β¨ SYNOPSIS β¨
bool is_subdir (struct dentry *new_dentry , struct dentry *old_dentry );
π ARGUMENTS π
new_dentryβ the new dentry, the fresh little entry we're checking. π«Άold_dentryβ the old dentry, the one it's being checked against. π
π DESCRIPTION π
Okay so here's the tea: is_subdir returns true if new_dentry is a subdirectory of the parent (at any depth). It returns false otherwise. No cap. β¨
β οΈ caller responsibility, bestie: the caller must ensure that "new_dentry" is pinned before calling is_subdir. Like, do not skip this. π
π₯ SEE ALSO π₯
Kernel file ./fs/dcache.c is the home base, and the whole friend group is:
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_ancestor(9)d_splice_alias(9)
okay bye bestie π
this page's source/version is ./fs, dated October 2026, and it's still is_subdir(9) β mwah! π«Ά
π¦ 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