kernfs_link_sibling(9)
π kernfs_link_sibling β a kernel API manual, bestie edition
Okay so real talk: this is a page from the kernel API manual, section 9, and the function we're obsessing over today is kernfs_link_sibling. Yes it's a long name. Yes it ate. Let's get into it π«Ά
β¨ NAME β¨
kernfs_link_sibling β the girlypop that links a kernfs_node into its sibling rbtree πΈ
β¨ SYNOPSIS β¨
int kernfs_link_sibling (struct kernfs_node *kn );
β¨ ARGUMENTS β¨
knβ thekernfs_nodeof interest π like, this is the node we're talking about, the main character of this whole operation honestly
β¨ DESCRIPTION β¨
So here's the vibe: kernfs_link_sibling links kn into its sibling rbtree β and that rbtree starts all the way up at kn->parent->dir.children. Yes, you read that right, we're going through the parent. π¦
Locking tea β: kernfs_rwsem is held exclusive. No sharing, no friends, exclusive. Do not come for this function without holding it, fr fr.
β¨ RETURN β¨
0on success β slay, we ate π-EEXISTon failure β ngl, it's already there π
β¨ SEE ALSO β¨
Kernel file ./fs/kernfs/dir.c β and here's the whole friend group, no cap:
kernfs_path_from_node_locked(9)kernfs_name(9)kernfs_path_from_node(9)pr_cont_kernfs_name(9)pr_cont_kernfs_path(9)kernfs_get_parent(9)kernfs_name_hash(9)kernfs_unlink_sibling(9)kernfs_get_active(9)kernfs_put_active(9)kernfs_drain(9)kernfs_get(9)kernfs_put(9)kernfs_node_from_dentry(9)kernfs_add_one(9)kernfs_find_ns(9)kernfs_find_and_get_ns(9)kernfs_walk_and_get_ns(9)kernfs_create_root(9)kernfs_destroy_root(9)kernfs_root_to_node(9)kernfs_create_dir_ns(9)kernfs_create_empty_dir(9)kernfs_next_descendant_post(9)kernfs_activate(9)kernfs_show(9)kernfs_remove(9)kernfs_break_active_protection(9)kernfs_unbreak_active_protection(9)kernfs_remove_self(9)kernfs_remove_by_name_ns(9)kernfs_rename_ns(9)
And that's the whole page, bestie π This one's from ./fs/kernfs, dated October 2026, and it lives at kernfs_link_sibling(9) β go off, icon π
π¦ 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