函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swapfile.c Create Date:2022-07-27 16:48:17
Last Modify:2020-03-17 22:19:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:swap_page_trans_huge_swapped

函数原型:static bool swap_page_trans_huge_swapped(struct swap_info_struct *si, swp_entry_t entry)

返回类型:bool

参数:

类型参数名称
struct swap_info_struct *si
swp_entry_tentry
1542  map等于vmalloc'ed array of usage counts
1543  roffset等于Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format
1544  offset等于und_down - round down to next specified power of 2*@x: the value to round*@y: multiple to round down to (must be a power of 2)* Rounds @x down to next multiple of @y (which must be a power of 2).* To perform arbitrary rounding down, use rounddown() below.(roffset, SWAPFILE_CLUSTER)
1546  bool ret = false
1548  ci等于Determine the locking method in use for this device. Return* swap_cluster_info if SSD-style cluster-based locking is in place.
1549  如果非ci或非cluster_is_huge(ci)则
1550  如果swap_count(map[roffset])则ret = true
1552  转到:unlock_out
1554 i小于SWAPFILE_CLUSTER循环
1555  如果swap_count(map[offset + i])则
1556  ret = true
1557  退出
1560  unlock_out :
1561  unlock_cluster_or_swap_info(si, ci)
1562  返回:ret
调用者
名称描述
page_swapped
free_swap_and_cacheFree the swap entry like above, but also try to* free the page cache entry if it is the last user.