函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:place_page_cache_page - replace a pagecache page with a new one*@old: page to be replaced*@new: page to replace with*@gfp_mask: allocation mode* This function replaces a page in the pagecache with a new one

函数原型:int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask)

返回类型:int

参数:

类型参数名称
struct page *old
struct page *new
gfp_tgfp_mask
813  mapping等于 See page-flags.h for PAGE_MAPPING_FLAGS
814  (等于freepage
815  offset等于 Our offset within mapping.
816  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, offset)
819  VM_BUG_ON_PAGE(!PageLocked(old), old)
820  VM_BUG_ON_PAGE(!PageLocked(new), new)
821  VM_BUG_ON_PAGE( See page-flags.h for PAGE_MAPPING_FLAGS , new)
823  get_page(new)
824  See page-flags.h for PAGE_MAPPING_FLAGS 等于mapping
825  Our offset within mapping. 等于offset
827  xas_lock_irqsave( & xas, flags)
828  xas_store() - Store this entry in the XArray
830  See page-flags.h for PAGE_MAPPING_FLAGS = NULL
832  如果非PageHuge(old)则__dec_node_page_state(new, NR_FILE_PAGES)
834  如果非PageHuge(new)则__inc_node_page_state(new, NR_FILE_PAGES)
836  如果PageSwapBacked(old)则__dec_node_page_state(new, NR_SHMEM)
838  如果PageSwapBacked(new)则__inc_node_page_state(new, NR_SHMEM)
840  xas_unlock_irqrestore( & xas, flags)
841  mem_cgroup_migrate(old, new)
842  如果freepagefreepage(old)
844  put_page(old)
846  返回:0