Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:do_mq_timedsend

Proto:static int do_mq_timedsend(mqd_t mqdes, const char __user *u_msg_ptr, size_t msg_len, unsigned int msg_prio, struct timespec64 *ts)

Type:int

Parameter:

TypeParameterName
mqd_tmqdes
const char __user *u_msg_ptr
size_tmsg_len
unsigned intmsg_prio
struct timespec64 *ts
973  ktime_t expires, * timeout = NULL
974  struct posix_msg_tree_node * new_leaf = NULL
975  ret = 0
978  If Value for the false possibility is greater at compile time(msg_prio >= (unsignedlong)MQ_PRIO_MAX) Then Return -EINVAL
981  If ts Then
982  expires = vert a timespec64 to ktime_t format:
983  timeout = expires
986  audit_mq_sendrecv(mqdes, msg_len, msg_prio, ts)
988  f = fdget(mqdes)
989  If Value for the false possibility is greater at compile time(!file) Then
990  ret = -EBADF
991  Go to out
994  inode = file_inode(file)
995  If Value for the false possibility is greater at compile time(f_op != & mqueue_file_operations) Then
996  ret = -EBADF
997  Go to out_fput
999  info = MQUEUE_I(inode)
1000  audit_file(file)
1002  If Value for the false possibility is greater at compile time(!(f_mode & le is open for writing )) Then
1003  ret = -EBADF
1004  Go to out_fput
1007  If Value for the false possibility is greater at compile time(msg_len > maximum message size ) Then
1008  ret = -EMSGSIZE
1009  Go to out_fput
1014  msg_ptr = load_msg(u_msg_ptr, msg_len)
1015  If IS_ERR(msg_ptr) Then
1016  ret = PTR_ERR(msg_ptr)
1017  Go to out_fput
1019  message text size = msg_len
1020  m_type = msg_prio
1027  If Not node_cache Then new_leaf = Allocation memory
1030  spin_lock( & lock)
1032  If Not node_cache && new_leaf Then
1034  Initialization list head
1035  node_cache = new_leaf
1036  new_leaf = NULL
1037  Else
1038  kfree(new_leaf)
1041  If number of messages currently queued == maximum number of messages Then
1042  If f_flags & O_NONBLOCK Then
1043  ret = -EAGAIN
1044  Else
1053  Go to out_free
1055  Else
1056  receiver = Returns waiting task that should be serviced first or NULL if none exists
1057  If receiver Then
1059  Else
1062  If ret Then Go to out_unlock
1066  i_atime = i_mtime = i_ctime = current_time(inode)
1069  out_unlock :
1070  spin_unlock( & lock)
1071  wake_up_q( & wake_q)
1072  out_free :
1073  If ret Then free_msg(msg_ptr)
1075  out_fput :
1076  fdput(f)
1077  out :
1078  Return ret
Caller
NameDescribe
SYSCALL_DEFINE5