Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:offset_to_swap_extent

Proto:static struct swap_extent *offset_to_swap_extent(struct swap_info_struct *sis, unsigned long offset)

Type:struct swap_extent

Parameter:

TypeParameterName
struct swap_info_struct *sis
unsigned longoffset
210  rb = rb_node
211  When rb cycle
212  se = rb_entry(rb, structswap_extent, rb_node)
213  If offset < start_page Then rb = rb_left
215  Else if offset >= start_page + nr_pages Then rb = rb_right
217  Else Return se
221  BUG()
Caller
NameDescribe
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.