Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\mqueue.c Create Date:2022-07-28 16:50:11
Last Modify:2020-03-17 23:00:47 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Auxiliary functions to manipulate messages' list

Proto:static int msg_insert(struct msg_msg *msg, struct mqueue_inode_info *info)

Type:int

Parameter:

TypeParameterName
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  When p cycle
139  parent = p
140  leaf = rb_entry(parent, structposix_msg_tree_node, rb_node)
142  If Value is more likely to compile time(priority == m_type) Then Go to insert_msg
144  Else if m_type < priority Then
145  p = rb_left
146  rightmost = false
147  Else p = rb_right
150  If node_cache Then
151  leaf = node_cache
152  node_cache = NULL
153  Else
154  leaf = Allocation memory
155  If Not leaf Then Return -ENOMEM
157  Initialization list head
159  priority = m_type
161  If rightmost Then msg_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  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
170  Return 0
Caller
NameDescribe
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