Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\btree.c Create Date:2022-07-28 06:53:47
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:rebalance

Proto:static void rebalance(struct btree_head *head, struct btree_geo *geo, unsigned long *key, int level, unsigned long *child, int fill)

Type:void

Parameter:

TypeParameterName
struct btree_head *head
struct btree_geo *geo
unsigned long *key
intlevel
unsigned long *child
intfill
543  unsigned long * parent, * left = NULL, * right = NULL
546  If fill == 0 Then
551  btree_remove_level(head, geo, key, level + 1)
552  mempool_free - return an element to the pool.*@element: pool element pointer.*@pool: pointer to the memory pool which was allocated via* mempool_create().* this function only sleeps if the free_fn() function sleeps.
553  Return
556  parent = locate the correct leaf node in the btree
557  i = getpos(geo, parent, key)
558  BUG_ON(bval(geo, parent, i) != child)
560  If i > 0 Then
561  left = bval(geo, parent, i - 1)
562  no_left = getfill(geo, left, 0)
563  If fill + no_left <= no_pairs Then
564  merge(head, geo, level, left, no_left, child, fill, parent, i - 1)
568  Return
571  If i + 1 < getfill(geo, parent, i) Then
572  right = bval(geo, parent, i + 1)
573  no_right = getfill(geo, right, 0)
574  If fill + no_right <= no_pairs Then
579  Return
Caller
NameDescribe
btree_remove_level