static inline unsigned long scan_swap_map(struct swap_info_struct *si) {

unsigned long offset, last_in_cluster;

if (unlikely(!si->cluster_nr)) { /* Find new cluster*/

We assume that si->cluster_nr is greater than 0, indicating that the current cluster still has free slots (recall that cluster_nr specifies the number of free slots in the current cluster). Once the kernel has ensured that the current offset does not exceed the limit set by swap_info->highest_bit, it checks whether the swap counter of the entry is 0 at the proposed position, indicating that the entry is available for use:

Continue reading here: Mmswapfilec

Was this article helpful?

0 0