sg_nents(9)
π« sg_nents(9) β the kernel API manual, but make it cute
Okay bestie, welcome to the sg_nents page, straight out of the Kernel API Manual β¨ (that's the manual name, in case you were wondering β yes, it's giving official).
πΈ NAME πΈ
sg_nents β returns the total count of entries in a scatterlist π
Like, literally just counts them for you. That's the whole vibe.
π¦ SYNOPSIS π¦
int sg_nents (struct scatterlist *sg );
Your function signature, untouched, unbothered, iconic π
β¨ ARGUMENTS β¨
sgβ the scatterlist π
That's it. One (1) argument. She's low maintenance like that.
π«Ά DESCRIPTION π«Ά
So what does she do? sg_nents lets you find out how many entries are in sg β and the important part, bestie, is that it's taking into account chaining as well π₯
No cap, that's the whole thing. If your scatterlist is chained together, she still counts the way she's supposed to. Fr fr. π
π SEE ALSO π
Kernel file ./lib/scatterlist.c β and the rest of the scatterlist cinematic universe π:
sg_nents_for_len(9)sg_nents_for_dma(9)sg_last(9)sg_init_table(9)sg_init_one(9)__sg_free_table(9)sg_free_append_table(9)sg_free_table(9)__sg_alloc_table(9)sg_alloc_table(9)sg_alloc_append_table_from_pages(9)sg_alloc_table_from_pages_segment(9)sgl_alloc_order(9)sgl_alloc(9)sgl_free_n_order(9)sgl_free_order(9)sgl_free(9)sg_miter_start(9)sg_miter_skip(9)sg_miter_next(9)sg_miter_stop(9)sg_copy_buffer(9)sg_copy_from_buffer(9)sg_copy_to_buffer(9)sg_pcopy_from_buffer(9)sg_pcopy_to_buffer(9)sg_zero_buffer(9)extract_iter_to_sg(9)
That's the whole friend group, and yes, they all match the original list exactly β I would never do you dirty like that π
Ok tiny note to self: all of these are section 9 refs, so they're kernel-API pages. Go read them if you're curious, bestie π§
π the sign-off π
This page lives in ./lib, and it's dated October 2026 β so mark your calendar, she's from the future π Byeee, go count some entries! ππ
π¦ 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