函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swap_state.c Create Date:2022-07-27 16:45:18
Last Modify:2020-03-17 22:02:06 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:init_swap_address_space

函数原型:int init_swap_address_space(unsigned int type, unsigned long nr_pages)

返回类型:int

参数:

类型参数名称
unsigned inttype
unsigned longnr_pages
602  nr等于DIV_ROUND_UP(nr_pages, SWAP_ADDRESS_SPACE_PAGES)
603  spaces等于kvcalloc(nr, sizeof(structaddress_space), GFP_KERNEL)
604  如果非spaces则返回:负ENOMEM
606 i小于nr循环
607  space等于spacesi
608  xa_init_flags() - Initialise an empty XArray with flags.*@xa: XArray.*@flags: XA_FLAG values.* If you need to initialise an XArray with special flags (eg you need* to take the lock from interrupt context), use this function instead* of xa_init().
609  atomic_set( & i_mmap_writable, 0)
610  a_ops等于swapper_space is a fiction, retained to simplify the path through* vmscan's shrink_page_list.
612  mapping_set_no_writeback_tags(space)
614  nr_swapper_spaces[type]等于nr
615  swapper_spaces[type]等于spaces
617  返回:0
调用者
名称描述
SYSCALL_DEFINE2