函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\power\snapshot.c Create Date:2022-07-27 11:00:30
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:add_rtree_block - Add a new leave node to the radix tree.* The leave nodes need to be allocated in order to keep the leaves* linked list in order. This is guaranteed by the zone->blocks* counter.

函数原型:static int add_rtree_block(struct mem_zone_bm_rtree *zone, gfp_t gfp_mask, int safe_needed, struct chain_allocator *ca)

返回类型:int

参数:

类型参数名称
struct mem_zone_bm_rtree *zone
gfp_tgfp_mask
intsafe_needed
struct chain_allocator *ca
435  block_nr等于Number of Bitmap Blocks
436  levels_needed等于0
439 block_nr循环
440  levels_needed加等于1
441  block_nr右移等于BM_RTREE_LEVEL_SHIFT
445 i小于levels_needed循环
446  node等于alloc_rtree_node - Allocate a new node and add it to the radix tree.* This function is used to allocate inner nodes as well as the* leave nodes of the radix tree. It also adds the node to the* corresponding linked list passed in by the *list parameter.
448  如果非node则返回:负ENOMEM
451  data[0]等于Radix Tree Root
452  Radix Tree Root 等于node
453  Number of Radix Tree Levels 加等于1
457  block等于alloc_rtree_node - Allocate a new node and add it to the radix tree.* This function is used to allocate inner nodes as well as the* leave nodes of the radix tree. It also adds the node to the* corresponding linked list passed in by the *list parameter.
458  如果非block则返回:负ENOMEM
462  node等于Radix Tree Root
463  dst等于Radix Tree Root
464  block_nr等于Number of Bitmap Blocks
465 i大于0循环
468  如果非node
471  如果非node则返回:负ENOMEM
473  dst等于node
476  index等于block_nr右移i减1的差乘BM_RTREE_LEVEL_SHIFT
477  index与等于BM_RTREE_LEVEL_MASK
478  dst = (struct rtree_node * * ) & (data[index])
479  node等于dst
482  Number of Bitmap Blocks 加等于1
483  dst等于block
485  返回:0
调用者
名称描述
create_zone_bm_rtreereate_zone_bm_rtree - Create a radix tree for one zone.* Allocated the mem_zone_bm_rtree structure and initializes it.* This function also allocated and builds the radix tree for the* zone.