folio_copy(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– folio_copy(9) β€” like, the whole scoop

okay so picture this: you're deep in the Kernel API Manual (yes, that one), and you land on folio_copy(9). She's small, she's mighty, and she's about to become your new fave. Let's get into it bestie πŸŽ€


✨ NAME ✨

folio_copy β€” Copy the contents of one folio to another. That's it, that's the whole vibe. No cap. πŸ’…


🌸 SYNOPSIS 🌸

void folio_copy (struct folio *dst , struct folio *src );

Look at her. Clean. Iconic. Returns nothing because she's not here to chat, she's here to work. πŸ‘‘


πŸ¦‹ ARGUMENTS πŸ¦‹

  • dst β€” the folio you're copying to. The destination. The main character receiving all the attention. 🫢
  • src β€” the folio you're copying from. The source. The origin story. Where the bytes are coming from. 🌈

πŸ’œ DESCRIPTION πŸ’œ

So the bytes living inside the folio that src represents get copied over into dst. Simple as that, fr fr. πŸ“

⚠️ Heads up bestie: this function assumes the caller has already validated that dst is at least as large as src. It does not check. It trusts you. Do not betray that trust. 😭

And here's the multitasking part πŸ‘‡

  • You can call it in atomic context β€” but only for order-0 folios.
  • If the folio is larger than that, it may sleep. πŸ’€

So like... know which one you've got before you go calling her from somewhere she can't nap. Periodt.


πŸ”₯ SEE ALSO πŸ”₯

Everything below lives in the kernel file ./mm/util.c β€” and yes, she has friends. A whole friend group. A whole squad. Look at this roster πŸ‘‘

kfree_const(9), __kmemdup_nul(9), kstrdup(9),
kstrdup_const(9), kstrndup(9), kmemdup(9), kmemdup_array(9),
kvmemdup(9), kmemdup_nul(9), memdup_user(9), vmemdup_user(9),
strndup_user(9), memdup_user_nul(9), randomize_page(9),
__account_locked_vm(9), account_locked_vm(9), __vmalloc_array(9),
vmalloc_array(9), __vcalloc(9), vcalloc(9), folio_mapping(9),
get_cmdline(9), mem_dump_obj(9), compat_set_desc_from_vma(9),
__compat_vma_mmap(9), compat_vma_mmap(9), snapshot_page(9),
mmap_action_prepare(9), mmap_action_complete(9), folio_pte_batch(9),
page_range_contiguous(9)

Not me listing all of them because every single one deserves a shoutout πŸ’– iykyk


and that's the whole page, babes β€” go forth and copy your folios responsibly 🧚

mwah πŸ’‹ this one's brought to you by the ./mm sources, dated October 2026, and filed under folio_copy(9). See you in the next manpage, bestie! 🌸✨

πŸ“¦ where this page comes from