find_hibernation_swap_type(9)
π 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 β¨
-EINVALifdeviceis invalid π-ENODEVif no matching swap device is found π
π SEE ALSO π
Kernel file ./mm/swapfile.c
swap_put_entries_cluster(9)swap_dup_entries_cluster(9)folio_alloc_swap(9)folio_dup_swap(9)folio_put_swap(9)swap_entry_swapped(9)folio_free_swap(9)swap_put_entries_direct(9)swap_alloc_hibernation_slot(9)swap_free_hibernation_slot(9)pin_hibernation_swap_type(9)unpin_hibernation_swap_type(9)
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
- 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