sg_nents_for_dma(9)
π sg_nents_for_dma β the Kernel API Manual tea π«Ά
okay so bestie, you're in the Kernel API Manual and today's main character is sg_nents_for_dma(9). she's a little function with a big job and honestly? she ate. let's get into it β¨
πΈ NAME πΈ
sg_nents_for_dma β returns the count of DMA-capable entries in a scatterlist. that's it, that's the vibe check π
π SYNOPSIS π
int sg_nents_for_dma (struct scatterlist *sgl , unsigned int sglen ,
size_t len );
look at her. three little params, one int coming back. iconic honestly.
π¦ ARGUMENTS π¦
sglβ the scatterlist itself, the whole point of the function, the moment πsglenβ the current number of entries (as in, how many you've got right now)lenβ the max length of a DMA-capable block
β¨ DESCRIPTION β¨
so what does she actually do? she figures out how many entries in sgl would be permitted in a DMA-capable transfer β like, if the list had been split accordingly. and yes, she's taking chaining into account too, because she's thorough like that π no cap, she's considering the whole situation.
π₯ RETURN π₯
she gives you back the number of sgl entries needed. that's the whole answer, bestie. the count. the receipts. periodt π
π SEE ALSO π
kernel file ./lib/scatterlist.c β and ok, the whole scatterlist friend group showed up, so let's give them their moment, one by one π«Ά
sg_nents(9)sg_nents_for_len(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)
ngl bestie, that's the entire roster β go read the whole squad if you want the full lore π§
and that's the page! sign-off time: this one's from the ./lib crew, dated October 2026, and it's sg_nents_for_dma(9) saying bye from the Kernel API Manual ππΈ catch you in the source, bestie π
π¦ 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