__sg_free_table(9)
π __sg_free_table(9) β Kernel API Manual π
Okay so bestie, welcome to the kernel API manual β¨ β this one's from the Kernel API Manual and it's all about __sg_free_table, which (spoiler) frees a previously mapped sg table. Cleanup era. We love a function that knows when to let go π
πΈ NAME πΈ
__sg_free_table β Free a previously mapped sg table π«Ά
β¨ SYNOPSIS β¨
void __sg_free_table (struct sg_table *table , unsigned int max_ents ,
unsigned int nents_first_chunk , sg_free_fn *free_fn , unsigned int
num_ents );
π ARGUMENTS π
tableβ the sg table header you're working with πmax_entsβ the maximum number of entries per single scatterlist β¨nents_first_chunkβ number of entries in the (preallocated) first scatterlist chunk.0means there's no such preallocated first chunk, iykyk πfree_fnβ the free function (yes, that's the whole description, she's lowkey self-explanatory π)num_entsβ number of entries in the table π₯
π¦ DESCRIPTION π¦
Free an sg table that was previously allocated and set up with __sg_alloc_table. It's giving "you made this mess, now clean it up" π§Ήβ¨
β οΈ Okay this part actually matters: themax_entsvalue must be identical to the one you previously used with__sg_alloc_table. No mixing and matching, bestie β they have to match fr fr π
π SEE ALSO π
Kernel file ./lib/scatterlist.c and the whole scatterlist friend group π«Ά:
sg_nents(9)sg_nents_for_len(9)sg_nents_for_dma(9)sg_last(9)sg_init_table(9)sg_init_one(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)
β¨ sign-off time β¨
That's the whole page, bestie β brought to you by ./lib π, October 2026 edition, and it's __sg_free_table(9) all the way down π Go free that table, you absolute 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