Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:init_swap_address_space

Proto:int init_swap_address_space(unsigned int type, unsigned long nr_pages)

Type:int

Parameter:

TypeParameterName
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  If Not spaces Then Return -ENOMEM
606  When i < nr cycle
607  space = spaces + i
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  Return 0
Caller
NameDescribe
SYSCALL_DEFINE2