Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Usually this function is quite similar to normal lookup. But the key of* a parent node may be smaller than the smallest key of all its siblings.* In such a case we cannot just return NULL, as we have only proven that no

Proto:void *btree_get_prev(struct btree_head *head, struct btree_geo *geo, unsigned long *__key)

Type:void

Parameter:

TypeParameterName
struct btree_head *head
struct btree_geo *geo
unsigned long *__key
316  retry_key = NULL
318  If keyzero(geo, __key) Then Return NULL
321  If height == 0 Then Return NULL
323  longcpy(key, __key, keylen)
324  retry :
325  dec_key(geo, key)
327  node = node
328  When height > 1 cycle
329  When i < no_pairs cycle If keycmp(geo, node, i, key) <= 0 Then
331  Break
332  If i == no_pairs Then Go to miss
334  oldnode = node
335  node = bval(geo, node, i)
336  If Not node Then Go to miss
338  retry_key = bkey(geo, oldnode, i)
341  If Not node Then Go to miss
344  When i < no_pairs cycle
345  If keycmp(geo, node, i, key) <= 0 Then
346  If bval(geo, node, i) Then
347  longcpy(__key, bkey(geo, node, i), keylen)
348  Return bval(geo, node, i)
349  Else Go to miss
353  miss :
354  If retry_key Then
355  longcpy(key, retry_key, keylen)
356  retry_key = NULL
357  Go to retry
359  Return NULL