Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:The only caller of this function is now suspend routine

Proto:swp_entry_t get_swap_page_of_type(int type)

Type:swp_entry_t

Parameter:

TypeParameterName
inttype
1082  si = swap_type_to_swap_info(type)
1085  If Not si Then Go to fail
1088  spin_lock( & protect map scan related fields like* swap_map, lowest_bit, highest_bit,* inuse_pages, cluster_next,* cluster_nr, lowest_alloc,* highest_alloc, free/discard cluster* list. other fields are only changed* at swapon/swapoff, so are protected* by swap_lock)
1089  If SWP_USED etc: see above & SWP_WRITEOK Then
1090  atomic_long_dec( & nr_swap_pages)
1092  offset = scan_swap_map(si, 1)
1093  If offset Then
1097  atomic_long_inc( & nr_swap_pages)
1099  spin_unlock( & protect map scan related fields like* swap_map, lowest_bit, highest_bit,* inuse_pages, cluster_next,* cluster_nr, lowest_alloc,* highest_alloc, free/discard cluster* list. other fields are only changed* at swapon/swapoff, so are protected* by swap_lock)
1100  fail :
1101  Return (swp_entry_t){0}
Caller
NameDescribe
alloc_swapdev_blockalloc_swapdev_block - allocate a swap page and register that it has* been allocated, so that it can be freed in case of an error.