A swap entry has two parts, one called the type (stored in an unsigned long), and one called the offset (stored in a data structure called a pgoff_t). The type is the swap area (partition or file) to use (there can be up to 32), the offset is the number of page sized (4kb) chunks to count from the beginning of the type. They’re both stored in a swap_entry_ t, which is an unsigned long stored inside a struct for protection. A swap_entry_t is created and manipulated through functions that live in include/linux/swapops.h. There is, for instance,

LinuxMM: SwapEntryRepresentation (last edited 2017-12-30 01:05:11 by localhost)