函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Wait until events become available, if we don't already have some. The* application must reap them itself, as they reside on the shared cq ring.

函数原型:static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events, const sigset_t __user *sig, size_t sigsz)

返回类型:int

参数:

类型参数名称
struct io_ring_ctx *ctx
intmin_events
const sigset_t __user *sig
size_tsigsz
4025  struct io_wait_queue iowq = {wq = {private = 当前进程, func = io_wake_function, entry = Simple doubly linked list implementation(entry), }, ctx = ctx, to_wait = min_events, }
4034  rings等于rings
4035  ret等于0
4037  如果io_cqring_events(ctx, false)大于等于min_events则返回:0
4040  如果sig
4042  如果in_compat_syscall()则ret等于set_compat_user_sigmask((constcompat_sigset_t__user * )sig, sigsz)
4045  否则ret等于The api helps set app-provided sigmasks
4049  如果ret则返回:ret
4053  nr_timeouts等于atomic_read( & cq_timeouts)
4054  _uring_cqring_wait - called before start waiting for an available CQE*@ctx: pointer to a ring context structure*@min_events: minimal number of events to wait for* Allows to track waiting for CQE, so that we can e
4055  循环
4056  prepare_to_wait_exclusive( & wait, & wq, 睡眠态)
4058  如果io_should_wake( & iowq, false)则退出
4060  进程调度
4061  如果signal_pending(当前进程)则
4062  ret等于负EINTR
4063  退出
4065  当1循环
4066  sh_wait - clean up after waiting in a queue*@wq_head: waitqueue waited on*@wq_entry: wait descriptor* Sets current thread back to running state and removes* the wait descriptor from the given waitqueue if still* queued.
4068  restore_saved_sigmask_unless(ret == - EINTR)
4070  返回:如果READ_ONCE(head)恒等于READ_ONCE(tail)则ret否则0
调用者
名称描述
SYSCALL_DEFINE6