函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:offset_to_swap_extent

函数原型:static struct swap_extent *offset_to_swap_extent(struct swap_info_struct *sis, unsigned long offset)

返回类型:struct swap_extent

参数:

类型参数名称
struct swap_info_struct *sis
unsigned longoffset
210  rb等于rb_node
211 rb循环
212  se等于rb_entry(rb, structswap_extent, rb_node)
213  如果offset小于start_pagerb等于rb_left
215  否则如果offset大于等于start_pagenr_pagesrb等于rb_right
217  否则返回:se
221  BUG()
调用者
名称描述
discard_swap_clusterswap allocation tell device that a cluster of swap can now be discarded,* to allow the swap device to optimize its wear-levelling.
map_swap_entryUse this swapdev's extent info to locate the (PAGE_SIZE) block which* corresponds to page offset for the specified swap entry.* Note that the type of this function is sector_t, but it returns page offset* into the bdev, not sector offset.