find_hibernation_swap_type(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– find_hibernation_swap_type(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” this one's find_hibernation_swap_type, and it's literally the "where's my swap device" girlie of hibernation. 🧚


✨ NAME ✨

find_hibernation_swap_type β€” find the swap type for hibernation, no cap 🫢


🌸 SYNOPSIS 🌸

int find_hibernation_swap_type (dev_t device , sector_t offset );

πŸŽ€ ARGUMENTS πŸŽ€

  • device β€” the block device that's holding the resume image πŸ‘‘
  • offset β€” the offset within the device that identifies the swap area, iykyk ⭐

πŸ¦‹ DESCRIPTION πŸ¦‹

So the whole vibe here is: locate the swap device that corresponds to device and offset. That's it, that's the mission. πŸ’…

Now, unlike pin_hibernation_swap_type, this function only performs a lookup β€” it does not mark the swap device as pinned for hibernation. Just a peek, no commitment. πŸ™ˆ

And that's totally safe in the sysfs-based hibernation path, because user space is already frozen there and swapoff can't run concurrently. So nobody's gonna yank the rug out from under you mid-lookup. 😭πŸ”₯


🌈 RETURN 🌈

  • A non-negative swap type on success β€” slay ✨
  • -EINVAL if device is invalid πŸ’€
  • -ENODEV if no matching swap device is found πŸ“

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./mm/swapfile.c


ngl bestie, if you're here it's probably because something in hibernation land is being dramatic. go read pin_hibernation_swap_type(9) next, it's giving sibling energy πŸ«ΆπŸ’œ

that's the whole page, mwah πŸ’‹ β€” brought to you by the gang in ./mm and dated October 2026 like the little time capsule it is πŸŽ€βœ¨

πŸ“¦ where this page comes from