Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swap_state.c Create Date:2022-07-28 15:14:33
Last Modify:2020-03-17 22:02:06 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:add_to_swap - allocate swap space for a page*@page: page we want to move to swap* Allocate swap space for the page and add the page to the* swap cache. Caller needs to hold the page lock.

Proto:int add_to_swap(struct page *page)

Type:int

Parameter:

TypeParameterName
struct page *page
193  VM_BUG_ON_PAGE(!PageLocked(page), page)
194  VM_BUG_ON_PAGE(!PageUptodate(page), page)
196  entry = get_swap_page(page)
197  If Not val Then Return 0
211  err = add_to_swap_cache resembles add_to_page_cache_locked on swapper_space,* but sets SwapCache flag and private instead of mapping and index.
213  If err Then Go to fail
229  Dirty a page
231  Return 1
233  fail :
234  put_swap_page(page, entry)
235  Return 0
Caller
NameDescribe
shrink_page_listshrink_page_list() returns the number of reclaimed pages