函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:How many references to @entry are currently swapped out?* This considers COUNT_CONTINUED so it returns exact answer.

函数原型:int swp_swapcount(swp_entry_t entry)

返回类型:int

参数:

类型参数名称
swp_entry_tentry
1505  p等于_swap_info_get(entry)
1506  如果非p则返回:0
1509  offset等于Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format
1511  ci等于Determine the locking method in use for this device. Return* swap_cluster_info if SSD-style cluster-based locking is in place.
1513  count等于swap_count(vmalloc'ed array of usage counts [offset])
1514  如果非count按位与See swap_map continuation for full count 的值则转到:out
1517  count与等于See swap_map continuation for full count 的反
1518  n等于Max duplication count, in first swap_map 加1
1520  page等于Walk a vmap address to the struct page it maps.
1521  offset与等于PAGE_MASK的反
1522  VM_BUG_ON(page_private(page) != SWP_CONTINUED)
1524  循环
1525  page等于list_next_entry - get the next element in list*@pos: the type * to cursor*@member: the name of the list_head within the struct.(page, lru)
1526  map等于kmap_atomic(page)
1527  tmp_count等于map[offset]
1528  Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(map)
1530  count加等于tmp_count按位与See swap_map continuation for full count 的反的值乘n
1531  n乘等于Max count, in each swap_map continuation 加1
1532 tmp_count按位与See swap_map continuation for full count 循环
1533  out :
1534  unlock_cluster_or_swap_info(p, ci)
1535  返回:count