函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Lookup a swap entry in the swap cache. A found page will be returned* unlocked and with its refcount incremented - we rely on the kernel* lock getting page table operations atomic even if we drop the page* lock before returning.

函数原型:struct page *lookup_swap_cache(swp_entry_t entry, struct vm_area_struct *vma, unsigned long addr)

返回类型:struct page

参数:

类型参数名称
swp_entry_tentry
struct vm_area_struct *vma
unsigned longaddr
316  si等于Check whether swap entry is valid in the swap device
317  如果非si则返回:NULL
319  page等于d_get_page - find and get a page reference*@mapping: the address_space to search*@offset: the page index* Looks up the page cache slot at @mapping & @offset. If there is a* page cache page, it is returned with an increased refcount.
320  put_swap_device(si)
322  INC_CACHE_INFO(find_total)
323  如果page
324  vma_ra等于swap_use_vma_readahead()
327  INC_CACHE_INFO(find_success)
332  如果此条件成立可能性小(为编译器优化)(PageTransCompound returns true for both transparent huge pages* and hugetlbfs pages, so it should only be called when it's known* that hugetlbfs pages aren't involved.)则返回:page
335  readahead等于TestClearPageReadahead(page)
336  如果vmavma_ra
341  win等于SWAP_RA_WIN(ra_val)
342  hits等于SWAP_RA_HITS(ra_val)
349  如果readahead
351  如果非vma或非vma_raatomic_inc( & swapin_readahead_hits)
356  返回:page