swap_cache_has_folio(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… swap_cache_has_folio(9) πŸ’…

okay so real talk, this is a page from the Kernel API Manual and honestly? it's a little one but she's important. literally the vibe check for swap slots. let's get into it 🫢


✨ NAME ✨

swap_cache_has_folio β€” bestie, this one checks if a swap slot has cache. that's the whole job. no cap. πŸ’–


🌸 SYNOPSIS 🌸

bool swap_cache_has_folio (swp_entry_t entry );

it returns a bool, she takes exactly one thing, and she is not complicated. iconic behavior honestly ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • entry β€” a swap entry that's pointing at the slot you're curious about. that's it, that's the argument. she's just here to tell you which slot we're talking about πŸ”₯

πŸ’€ CONTEXT πŸ’€

okay this part is the serious part, listen up:

the caller must make sure entry is valid, and must protect the swap device either with a reference count or with locks. like, that's on you, not on her. she's not doing the vibes-checking for you πŸ™ˆ

no like fr fr, don't skip this bit. validity + protection (refcount or locks) is the whole prerequisite. don't be that person 😭

πŸ¦‹ SEE ALSO πŸ¦‹

she does not exist in a vacuum, she's got a whole friend group:

like she literally ate and left crumbs, go read the whole squad πŸ‘‘


and that's the page!! πŸ’œ

cute little sign-off moment: this whole thing comes from ./mm, dated October 2026, and yes she's filed under swap_cache_has_folio(9) for all your future reference needs πŸ“βœ¨ mwah, go touch some folios 🧚

πŸ“¦ where this page comes from