函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:添加定时器到时钟队列

函数原型:bool timerqueue_add(struct timerqueue_head *head, struct timerqueue_node *node)

返回类型:bool

参数:

类型参数名称
struct timerqueue_head *head
struct timerqueue_node *node
29  p等于rb_node
30  struct rb_node * parent = NULL
32  bool leftmost = true
35  WARN_ON_ONCE(!'empty' nodes are nodes that are known not to be inserted in an rbtree ( & node))
37 p循环
38  parent等于p
39  ptr等于rb_entry(parent, structtimerqueue_node, node)
40  如果expires小于expires
41  p等于rb_left
42  否则
43  p等于rb_right
44  leftmost = false
47  rb_link_node( & node, parent, p)
48  rb_insert_color_cached( & node, & rb_root, leftmost)
50  返回:leftmost
调用者
名称描述
alarmtimer_enqueuealarmtimer_enqueue - Adds an alarm timer to an alarm_base timerqueue*@base: pointer to the base where the timer is being run*@alarm: pointer to alarm being enqueued.* Adds alarm to a alarm_base timerqueue* Must hold base->lock when calling.
enqueue_hrtimerqueue_hrtimer - internal function to (re)start a timer* The timer is inserted in expiry order. Insertion into the* red black tree is O(log(n)). Must hold the base lock.* Returns 1 when the new timer is the leftmost timer in the tree.