memcpy_to_folio(9)
β¨ memcpy_to_folio π«
okay so real talk, bestie β this page is from the Kernel API Manual and it's about memcpy_to_folio, which literally just copies a range of bytes to a folio. that's it. that's the whole vibe. she's simple, she's iconic, she does one thing and she ate π
πΈ NAME πΈ
memcpy_to_folio β Copy a range of bytes to a folio. no cap, that's the entire job description π«Ά
π SYNOPSIS π
void memcpy_to_folio (struct folio *folio , size_t offset , const char
*from , size_t len );
look at her. void return, four args, zero drama. she takes a folio pointer, an offset, a source pointer, and a length β and she just sends it β¨
π¦ ARGUMENTS π¦
okay so let's go through the whole squad one by one, bestie:
folioβ the folio to write to. this is the main character right here π everything else is just supporting cast to get bytes into this girl.offsetβ the first byte in the folio to store to. like where in the folio you're starting your little writing session. don't skip ahead, don't start at zero unless you mean it πfromβ the memory to copy from. the source material. the origin story. where the bytes are coming out of πlenβ the number of bytes to copy. how many bytes you're moving. the amount. the quantity. the whole point π
ngl the arg list is short but every single one matters β mix upoffsetandlenand it's giving chaos, not cute π
π SEE ALSO π
okay so this is the part where the man page just dumps the entire friend group on you, and honestly? iconic behaviour. here's everyone, no skips, no cuts π
kernel file ./include/linux/highmem.h, plus:
kmap(9)kunmap(9)kmap_to_page(9)kmap_flush_unused(9)kmap_local_page(9)kmap_local_folio(9)kmap_atomic(9)clear_user_page(9)clear_user_pages(9)clear_user_highpage(9)clear_user_highpages(9)vma_alloc_zeroed_movable_folio(9)memcpy_from_folio(9)folio_zero_tail(9)folio_fill_tail(9)memcpy_from_file_folio(9)folio_zero_segments(9)folio_zero_segment(9)folio_zero_range(9)folio_release_kmap(9)
like yes that's a lot of friends but they're all in the same highmem.h-adjacent friend group so it tracks π note that memcpy_from_folio(9) is literally her reverse-coded twin β obsessed with that for them π«Ά
and that's the whole page, bestie! she lives in ./include/linux, the page is dated October 2026, and this whole thing is from the Kernel API Manual (source + version, as promised, mentioned cutely at the very end like a true sign-off π). mwah, go forth and copy those bytes β¨ππ
π¦ 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