softleaf_to_folio(9)
β¨ softleaf_to_folio β kernel API manual, section 9 bestie β¨
okay so we're doing softleaf_to_folio(9) today and honestly? it's giving "small function, big responsibility" π
this one lives in the Kernel API Manual and it's here to hand you a struct folio when all you've got is a leaf entry. iconic behavior fr fr.
πΈ NAME πΈ
softleaf_to_folio β obtains the struct folio for the PFN that's encoded up inside a leaf entry π
like. the leaf entry is being sneaky and hiding a PFN in there, and this function goes "no babe, we're getting her out" and hands you the folio. obsessed.
π SYNOPSIS π
struct folio * softleaf_to_folio (softleaf_t entry );
that's it. one argument. one pointer back. we love a low-effort queen β¨
π ARGUMENTS π
entryβ the leaf entry itself, and listen:softleaf_has_pfn(entry)must return true. that's not a vibe suggestion, that's a requirement, no cap. if you roll up with an entry that doesn't have a PFN, that's on you π«Ά
π RETURN π
a pointer to the struct folio that's associated with the leaf entry's PFN π« that's the whole deal, that's the tea.
π¦ SEE ALSO π¦
the kernel file ./include/linux/leafops.h is the home base for all of this, and it's literally a whole friend group of functions. go say hi to all of them:
softleaf_mk_none(9)softleaf_from_pte(9)softleaf_to_pte(9)softleaf_from_pmd(9)softleaf_to_pmd(9)softleaf_is_none(9)softleaf_type(9)softleaf_is_swap(9)softleaf_is_migration_write(9)softleaf_is_migration_read(9)softleaf_is_migration_read_exclusive(9)softleaf_is_migration(9)softleaf_is_device_private_write(9)softleaf_is_device_private(9)softleaf_is_device_exclusive(9)softleaf_is_hwpoison(9)softleaf_is_marker(9)softleaf_to_marker(9)softleaf_has_pfn(9)softleaf_to_pfn(9)softleaf_to_page(9)softleaf_is_poison_marker(9)softleaf_is_guard_marker(9)softleaf_is_uffd_wp_marker(9)softleaf_is_migration_young(9)softleaf_is_migration_dirty(9)pte_is_marker(9)pte_is_uffd_wp_marker(9)pte_is_uffd_marker(9)pmd_is_device_private_entry(9)pmd_is_migration_entry(9)softleaf_is_valid_pmd_entry(9)pmd_is_valid_softleaf(9)pmd_to_softleaf_folio(9)
that's the whole squad, iykyk π
k bye bestie, this page came from ./include/linux and it's dated October 2026, and the manual page is literally called softleaf_to_folio(9) in case you forgot already π mwah, go read your folios πβ¨
π¦ 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