Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\power\snapshot.c Create Date:2022-07-28 10:00:24
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name: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.

Proto:static int add_rtree_block(struct mem_zone_bm_rtree *zone, gfp_t gfp_mask, int safe_needed, struct chain_allocator *ca)

Type:int

Parameter:

TypeParameterName
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  When block_nr cycle
440  levels_needed += 1
441  block_nr >>= BM_RTREE_LEVEL_SHIFT
445  When i < levels_needed cycle
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  If Not node Then Return -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  If Not block Then Return -ENOMEM
462  node = Radix Tree Root
463  dst = Radix Tree Root
464  block_nr = Number of Bitmap Blocks
465  When i > 0 cycle
468  If Not node Then
471  If Not node Then Return -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  Return 0
Caller
NameDescribe
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.