list_count_nodes(9)
π list_count_nodes(9) π
okay so this is list_count_nodes, and it lives in the Kernel API Manual, section 9 β the kernel-internals girlies know exactly what section 9 means π§β¨
β¨ NAME β¨
list_count_nodes β count nodes in the list π
πΈ SYNOPSIS πΈ
size_t list_count_nodes (struct list_head *head );
that's it. that's the whole signature. no cap, she's lowkey tiny π
π¦ ARGUMENTS π¦
headβ the head for your list. that's literally the whole description bestie, she's not gonna elaborate π it's the head of the list you want counted, periodt.
ngl the page is short and that's iconic of it β the synopsis hands you back a size_t, and there's no RETURN VALUE section on this page to spell it out, so don't @ me with extra lore I can't back up π
π₯ SEE ALSO π₯
the full lineup, fr fr β and yes you're getting every single one because we don't gatekeep π
the LIST_HEAD / init girlies π
adding & removing, the classics π©·
list_add(9)list_add_tail(9)list_add_tail_release(9)list_del(9)list_replace(9)list_replace_init(9)list_swap(9)list_del_init(9)list_move(9)list_move_tail(9)list_bulk_move_tail(9)
vibe checks & careful deletions β
list_is_first(9)list_is_last(9)list_is_head(9)list_empty(9)list_del_init_careful(9)list_empty_careful(9)list_rotate_left(9)list_rotate_to_front(9)list_is_singular(9)list_cut_position(9)list_cut_before(9)
splicing, she's connecting people π«Ά
getting the actual data out of the node π
list_entry(9)list_first_entry(9)list_last_entry(9)list_first_entry_or_null(9)list_first_entry_or_null_acquire(9)list_last_entry_or_null(9)list_next_entry(9)list_next_entry_circular(9)list_prev_entry(9)list_prev_entry_circular(9)
loops, loops, and more loops π (main character energy)
list_for_each(9)list_for_each_continue(9)list_for_each_prev(9)list_for_each_safe(9)list_for_each_prev_safe(9)list_entry_is_head(9)list_for_each_entry(9)list_for_each_entry_reverse(9)list_prepare_entry(9)list_for_each_entry_continue(9)list_for_each_entry_continue_reverse(9)list_for_each_entry_from(9)list_for_each_entry_from_reverse(9)list_for_each_entry_safe(9)list_for_each_entry_safe_continue(9)list_for_each_entry_safe_from(9)list_for_each_entry_safe_reverse(9)list_safe_reset_next(9)
and the hlist cousins showed up too, obsessed π
hlist_unhashed(9)hlist_unhashed_lockless(9)hlist_empty(9)hlist_del(9)hlist_del_init(9)hlist_add_head(9)hlist_add_before(9)hlist_add_behind(9)hlist_add_fake(9)hlist_fake(9)hlist_is_singular_node(9)hlist_move_list(9)hlist_splice_init(9)hlist_for_each_entry(9)hlist_for_each_entry_continue(9)hlist_for_each_entry_from(9)hlist_for_each_entry_safe(9)hlist_count_nodes(9)
kernel file to go read, iykyk π
./include/linux/list.h
and that's the whole page bestie, short and sweet, she ate and left no crumbs πβ¨
source path: ./include/linux Β· date: October 2026 Β· page: list_count_nodes(9) β mwah, love u, go count some nodes π
ππ
π¦ 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