zswap_load(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ zswap_load(9) β€” the kernel API manual, bestie edition πŸ’œ

okay so picture this: it's a zswap_load(9) situation and you're just a girl trying to pull a folio back out of zswap. this is the page for that. pull up a chair. πŸŽ€


✨ NAME ✨

zswap_load β€” load a folio from zswap, no cap


🌸 SYNOPSIS 🌸

int zswap_load (struct folio *folio );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • folio β€” the folio to load. that's the whole argument. one folio. the folio in question. her. πŸ’…

πŸ’€ RETURN πŸ’€

two possible outcomes, and one of them is a whole list, which β€” plot twist β€” does not live here, it lives down in DESCRIPTION (iykyk, the manpage writer had a vision):

  • 0 on success, with the folio unlocked and marked up-to-date πŸ’–
  • or one of the following error codes (listed below, in DESCRIPTION, because we're doing that today 😭)

🌈 DESCRIPTION 🌈

bestie, here's where the receipts actually are. the error codes, in their full glory:

  • -EIO β€” if the swapped out content was in zswap, but it could not be loaded into the page due to a decompression failure. the folio is unlocked, but NOT marked up-to-date, so that an IO error is emitted (e.g. do_swap_page will SIGBUS). 🫠
  • -EINVAL β€” if the swapped out content was in zswap, but the page belongs to a large folio, which is not supported by zswap. the folio is unlocked, but NOT marked up-to-date, so that an IO error is emitted (e.g. do_swap_page will SIGBUS). πŸ™ˆ
  • -ENOENT β€” if the swapped out content was not in zswap. the folio remains locked on return. so like. it's staying right where it is. πŸ’€
lowkey important: two of those leave you unlocked but NOT up-to-date (hence the IO error / SIGBUS), while -ENOENT leaves you locked. don't mix them up, bestie, that's the whole vibe check of this page. ⭐

🧚 SEE ALSO 🧚

  • Kernel file ./mm/zswap.c β€” go read the source, it's giving main character energy πŸ‘‘

that's the whole page, fr fr. this little icon came from the ./mm corner of the world, dated October 2026, and you can find her living her best life in the Kernel API Manual as zswap_load(9). go forth and load those folios responsibly πŸ«Άβœ¨πŸ“

πŸ“¦ where this page comes from