sg_alloc_table(9)
β¨ sg_alloc_table(9) β¨
okay so bestie, welcome to the kernel API manual, section 9, and today's main character is sg_alloc_table π
this one's from ./lib and it's literally all about setting up your scatterlist table, so let's get into it π
πΈ NAME πΈ
sg_alloc_table β allocate and initialize an sg table, periodt β¨
π¦ SYNOPSIS π¦
int sg_alloc_table (struct sg_table *table , unsigned int nents , gfp_t
gfp_mask );
like, that's the whole vibe. it hands you back an int, no cap π«Ά
π ARGUMENTS π
tableβ the sg table header you're gonna use, bestie πnentsβ how many entries are in the sg list, fr fr π’gfp_maskβ the GFP allocation mask, that's the memory vibes π
π DESCRIPTION π
So what does it actually do? It allocates and initializes an sg table π« easy.
But here's the tea π: if nents is larger than SG_MAX_SINGLE_ALLOC, then a chained sg table will be set up. that's the plot twist, iykyk ππ₯
π SEE ALSO π
okay this list is long and honestly iconic, so buckle up bestie π§
Kernel file ./lib/scatterlist.c, plus: 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_table(9), sg_free_append_table(9), sg_free_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, if you're messing with scatterlists, read these too. the kernel does not play about memory, so stay safe out there π
and that's a wrap, bestie!! π«Ά this lil page lives in ./lib, dated October 2026, and the source/version line is sg_alloc_table(9) β slay, go allocate something gorgeous β¨ππ
π¦ 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