Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\frontswap.c Create Date:2022-07-28 15:21:23
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:"Store" data from a page to frontswap and associate it with the page's* swaptype and offset

Proto:int __frontswap_store(struct page *page)

Type:int

Parameter:

TypeParameterName
struct page *page
247  ret = -1
248  swp_entry_t entry = {val = page_private(page), }
249  type = Extract the `type' field from a swp_entry_t. The swp_entry_t is in* arch-independent format
250  sis = swap_info[type]
251  offset = Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format
254  VM_BUG_ON(!swap_ops are added by frontswap_register_ops, and provide the* frontswap "backend" implementation functions. Multiple implementations* may be registered, but implementations can never deregister. This)
255  VM_BUG_ON(!PageLocked(page))
256  VM_BUG_ON(sis == NULL)
264  If __frontswap_test(sis, offset) Then
265  __frontswap_clear(sis, offset)
266  for_each_frontswap_ops(ops)
267  invalidate_page(type, offset)
272  ret = store(type, offset, page)
273  If Not ret Then Break
276  If ret == 0 Then
277  __frontswap_set(sis, offset)
278  inc_frontswap_succ_stores()
279  Else
280  inc_frontswap_failed_stores()
282  If If enabled, frontswap_store will return failure even on success Then ret = -1
285  Return ret