sg_miter_next(9)
π sg_miter_next(9) β like, the actual manual page, bestie
Ok so first things first: this is a page from the Kernel API Manual, and today's main character is sg_miter_next. Buckle up, it's short but it matters. π
β¨ NAME β¨
sg_miter_next β proceed mapping iterator to the next mapping
πΈ SYNOPSIS πΈ
bool sg_miter_next (struct sg_mapping_iter *miter );
π¦ ARGUMENTS π¦
miterβ the sg mapping iter you want to proceed, bestie. that's the whole vibe of this function tbh.
π DESCRIPTION π
Ok so here's the tea: sg_miter_next proceeds miter to the next mapping. β¨
Now, important detail, don't skip this β miter should have been started using sg_miter_start. Like, it needs to already exist and be set up properly, no cap. π
On successful return, three things point to the current mapping:
miter->pagemiter->addrmiter->length
All three, together, pointing right at the current mapping. Gorgeous. Literally it's giving "the whole squad showed up." π
π CONTEXT π
May sleep if !SG_MITER_ATOMIC && !SG_MITER_LOCAL.
So likeβ¦ only under those exact conditions, and nowhere else. Read those flags twice, fr fr. π«Ά
β RETURN β
trueβ if miter contains the next mapping. slay. πfalseβ if end of sg list is reached. that's it, we're done, no more mappings, the era has ended. π
π SEE ALSO π
Kernel file ./lib/scatterlist.c β and like, the entire scatterlist extended family, honestly:
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_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_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 group chat, every single one of them, no one left on read. π
and yeah β ./lib, October 2026. that's where this page lives and when it was dated. π§ consider that the cute lil sign-off, mwah π
π¦ 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