函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\frontswap.c Create Date:2022-07-27 16:51:53
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:"Store" data from a page to frontswap and associate it with the page's* swaptype and offset

函数原型:int __frontswap_store(struct page *page)

返回类型:int

参数:

类型参数名称
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  如果__frontswap_test(sis, offset)则
265  __frontswap_clear(sis, offset)
266  for_each_frontswap_ops(ops)
267  invalidate_page(type, offset)
272  ret等于store(type, offset, page)
273  如果非ret退出
276  如果ret恒等于0则
277  __frontswap_set(sis, offset)
278  inc_frontswap_succ_stores()
279  否则
280  inc_frontswap_failed_stores()
282  如果If enabled, frontswap_store will return failure even on successret等于负1
285  返回:ret