Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\aio.c Create Date:2022-07-28 20:21:14
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:lookup_ioctx

Proto:static struct kioctx *lookup_ioctx(unsigned long ctx_id)

Type:struct kioctx

Parameter:

TypeParameterName
unsigned longctx_id
1049  __user * ring = ctx_id
1050  mm = mm
1051  struct kioctx * ctx, * ret = NULL
1055  If Get a simple variable from user space(id, & kernel internal index number ) Then Return 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 = fetch RCU-protected pointer for dereferencing(ioctx_table)
1061  If Not table || id >= nr Then Go to 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 = fetch RCU-protected pointer for dereferencing(table[id])
1066  If ctx && user_id == ctx_id Then
1067  If 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 killed Then ret = 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  Return ret
Caller
NameDescribe
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