Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:This must be called only on pages that have* been verified to be in the swap cache.

Proto:void __delete_from_swap_cache(struct page *page, swp_entry_t entry)

Type:void

Parameter:

TypeParameterName
struct page *page
swp_entry_tentry
160  address_space = swap_address_space(entry)
161  nr = hpage_nr_pages(page)
162  idx = Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format
163  XA_STATE() - Declare an XArray operation state.*@name: Name of this operation state (usually xas).*@array: Array to operate on.*@index: Initial index of interest.* Declare and initialise an xa_state on the stack.(xas, & i_pages, idx)
165  VM_BUG_ON_PAGE(!PageLocked(page), page)
166  VM_BUG_ON_PAGE(!PageSwapCache(page), page)
167  VM_BUG_ON_PAGE(Only test-and-set exist for PG_writeback. The unconditional operators are* risky: they bypass page accounting., page)
169  When i < nr cycle
170  entry = xas_store() - Store this entry in the XArray
171  VM_BUG_ON_PAGE(entry != page, entry)
172  set_page_private(page + i, 0)
173  xas_next() - Move state to next index.*@xas: XArray operation state.* If the @xas was in an error state, it will remain in an error state* and this function will return %NULL. If the @xas has never been walked,
175  ClearPageSwapCache(page)
176  nrpages -= nr
177  __mod_node_page_state(page_pgdat(page), NR_FILE_PAGES, - nr)
178  ADD_CACHE_INFO(del_total, nr)
Caller
NameDescribe
delete_from_swap_cacheThis must be called only on pages that have* been verified to be in the swap cache and locked.* It will never put the page into the free list,* the caller has a reference on the page.