Info

#define SWP_TYPE_SHIFT(e) (sizeof(e.val) * 8 - MAX_SWAPFILES_SHIFT)

#define SWP_OFFSET_MASK(e) ((1UL << SWP_TYPE_SHIFT(e)) - 1)

max_swapfiles_shift has the value 5, regardless of platform. The length of unsigned long on 32-bit architectures is 4; on 64-bit platforms, it is 8 bytes.

This special arrangement is relatively uninteresting for the rest of the kernel code. Much more important are the functions that extract the individual components from the structure:

Continue reading here: Info

Was this article helpful?

0 0