函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\mqueue.c Create Date:2022-07-27 18:25:26
Last Modify:2020-03-17 23:00:47 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Auxiliary functions to manipulate messages' list

函数原型:static int msg_insert(struct msg_msg *msg, struct mqueue_inode_info *info)

返回类型:int

参数:

类型参数名称
struct msg_msg *msg
struct mqueue_inode_info *info
133  struct rb_node * * p, * parent = NULL
135  bool rightmost = true
137  p等于rb_node
138 p循环
139  parent等于p
140  leaf等于rb_entry(parent, structposix_msg_tree_node, rb_node)
142  如果此条件成立可能性大(为编译器优化)(priority == m_type)则转到:insert_msg
144  否则如果m_type小于priority
145  p等于rb_left
146  rightmost = false
147  否则p等于rb_right
150  如果node_cache
151  leaf等于node_cache
152  node_cache = NULL
153  否则
154  leaf等于开辟内存
155  如果非leaf则返回:负ENOMEM
157  初始化链表头
159  priority等于m_type
161  如果rightmostmsg_tree_rightmost等于rb_node
164  rb_link_node( & rb_node, parent, p)
165  rb_insert_color( & rb_node, & msg_tree)
166  insert_msg :
167  number of messages currently queued 自加
168  size of queue in memory (sum of all msgs) 加等于message text size
169  添加链表项
170  返回:0
调用者
名称描述
pipelined_receivepipelined_receive() - if there is task waiting in sys_mq_timedsend()* gets its message and put to the queue (we have one free place for sure).
do_mq_timedsend