Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swapfile.c Create Date:2022-07-28 15:16:50
Last Modify:2020-03-17 22:19:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:swap_range_alloc

Proto:static void swap_range_alloc(struct swap_info_struct *si, unsigned long offset, unsigned int nr_entries)

Type:void

Parameter:

TypeParameterName
struct swap_info_struct *si
unsigned longoffset
unsigned intnr_entries
676  end = offset + nr_entries - 1
678  If offset == dex of first free in swap_map Then dex of first free in swap_map += nr_entries
680  If end == dex of last free in swap_map Then dex of last free in swap_map -= nr_entries
682  umber of those currently in use += nr_entries
683  If umber of those currently in use == al of usable pages of swap Then
684  dex of first free in swap_map = xtent of the swap_map
685  dex of last free in swap_map = 0
686  del_from_avail_list(si)
Caller
NameDescribe
scan_swap_map_slots
swap_alloc_cluster