folio_fill_tail(9)
π folio_fill_tail(9) β from the Kernel API Manual, bestie β¨
Okay so sit down, grab a strawberry π, because today we're talking about folio_fill_tail β yes that's the function name and yes it's giving main character energy in the highmem header world.
β¨ NAME β¨
folio_fill_tail β copies some data to a folio and then pads it out with zeroes. Like, it fills the tail. The name literally ate. π
π SYNOPSIS π
void folio_fill_tail (struct folio *folio , size_t offset , const char
*from , size_t len );
That's the whole signature, no cap. No return value, it's a void β it just does the thing. π¦
πΈ ARGUMENTS πΈ
folioβ the destination folio π like, where the data is going. The place. The venue. The location.offsetβ the offset intofolioat which to start copying π― so like, how far in you start writing.fromβ the data to copy π your source material, your payload, your vibes.lenβ how many bytes of data to copy π₯ the exact amount, not a byte more of copyin'.
π DESCRIPTION π
Okay so this function is most useful for filesystems which support inline data. When they want to copy data from the inode into the page cache, this function does everything for them β like a bestie who handles the group chat logistics so you don't have to π«Ά no cap.
And the slay part? It supports large folios even on HIGHMEM configurations. Iconic. It just works. β¨
Fr fr, the "does everything for them" is doing a lot of lifting here β the zero-padding of the tail is part of the deal. Don't forget it. π
π¦ SEE ALSO π¦
Kernel file ./include/linux/highmem.h β and honestly the whole kmap friend group, listed here in full because we don't skip anybody:
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)memcpy_to_folio(9)folio_zero_tail(9)memcpy_from_file_folio(9)folio_zero_segments(9)folio_zero_segment(9)folio_zero_range(9)folio_release_kmap(9)
Like, that's the entire squad right there. Iykyk. π
Mwah π β this page lives in ./include/linux, dated October 2026, and that's the whole folio_fill_tail(9) lore. Go copy some data and pad those zeroes, bestie. Periodt. π§ββοΈβ¨
π¦ 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