函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:swap_alloc_cluster

函数原型:static int swap_alloc_cluster(struct swap_info_struct *si, swp_entry_t *slot)

返回类型:int

参数:

类型参数名称
struct swap_info_struct *si
swp_entry_t *slot
940  如果非IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_THP_SWAP)则
941  VM_WARN_ON_ONCE(1)
942  返回:0
945  如果cluster_list_empty( & clusters list )则返回:0
948  idx等于cluster_list_first( & clusters list )
949  offset等于idxSWAPFILE_CLUSTER
950  ci等于lock_cluster(si, offset)
951  alloc_cluster(si, idx)
952  cluster_set_count_flag(ci, SWAPFILE_CLUSTER, This cluster is backing a transparent huge page )
954  map等于vmalloc'ed array of usage counts offset
955 i小于SWAPFILE_CLUSTER循环map[i]等于Flag page is cached, in first swap_map
957  unlock_cluster(ci)
958  swap_range_alloc(si, offset, SWAPFILE_CLUSTER)
959  slot等于Store a type+offset into a swp_entry_t in an arch-independent format
961  返回:1
调用者
名称描述
get_swap_pages