函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:lookup_ioctx

函数原型:static struct kioctx *lookup_ioctx(unsigned long ctx_id)

返回类型:struct kioctx

参数:

类型参数名称
unsigned longctx_id
1049  __userring等于ctx_id
1050  mm等于mm
1051  struct kioctx * ctx, * ret = NULL
1055  如果Careful: we have to cast the result to the type of the pointer* for sign reasons(id, & kernel internal index number )则返回:NULL
1058  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
1059  table等于cu_dereference() - fetch RCU-protected pointer for dereferencing*@p: The pointer to read, prior to dereferencing* This is a simple wrapper around rcu_dereference_check().(ioctx_table)
1061  如果非tableid大于等于nr则转到:out
1064  id等于array_index_nospec - sanitize an array index after a bounds check* For a code sequence like:* if (index < size) {* index = array_index_nospec(index, size);* val = array[index];* }* (id, nr)
1065  ctx等于cu_dereference() - fetch RCU-protected pointer for dereferencing*@p: The pointer to read, prior to dereferencing* This is a simple wrapper around rcu_dereference_check().(table[id])
1066  如果ctxuser_id恒等于ctx_id
1067  如果percpu_ref_tryget_live - try to increment a live percpu refcount*@ref: percpu_ref to try-get* Increment a percpu refcount unless it has already been killedret等于ctx
1070  out :
1071  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1072  返回:ret
调用者
名称描述
SYSCALL_DEFINE1sys_io_destroy:* Destroy the aio_context specified. May cancel any outstanding * AIOs and block on completion. Will fail with -ENOSYS if not* implemented. May fail with -EINVAL if the context pointed to* is invalid.
SYSCALL_DEFINE3sys_io_submit:* Queue the nr iocbs pointed to by iocbpp for processing
COMPAT_SYSCALL_DEFINE3
SYSCALL_DEFINE3sys_io_cancel:* Attempts to cancel an iocb previously passed to io_submit. If* the operation is successfully cancelled, the resulting event is* copied into the memory pointed to by result without being placed* into the completion queue and 0 is returned
do_io_getevents