函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:kill_ioctx* Cancels all outstanding aio requests on an aio context. Used* when the processes owning a context have all exited to encourage* the rapid destruction of the kioctx.

函数原型:static int kill_ioctx(struct mm_struct *mm, struct kioctx *ctx, struct ctx_rq_wait *wait)

返回类型:int

参数:

类型参数名称
struct mm_struct *mm
struct kioctx *ctx
struct ctx_rq_wait *wait
821  加自旋锁
822  如果atomic_xchg( & dead, 1)则
823  自旋锁解锁
824  返回:负EINVAL
827  table等于Dependency order vs. p above. (ioctx_table)
828  WARN_ON(ctx != cu_access_pointer() - fetch RCU pointer with no dereferencing*@p: The pointer to read* Return the value of the specified RCU-protected pointer, but omit the* lockdep checks for being in an RCU read-side critical section(table[id]))
829  RCU_INIT_POINTER() - initialize an RCU protected pointer*@p: The pointer to be initialized.*@v: The value to initialized the pointer to.* Initialize an RCU-protected pointer in special cases where readers(table[id], NULL)
830  自旋锁解锁
833  wake_up_all( & wait)
842  aio_nr_sub(* This is what userspace passed to io_setup(), it's not used for * anything but counting against the global max_reqs quota. * The real limit is nr_events - 1, which will be larger (see * aio_setup_ring()))
844  如果mmap_sizevm_munmap(mmap_base, mmap_size)
847  * signals when all in-flight requests are done等于wait
848  percpu_ref_kill - drop the initial ref*@ref: percpu_ref to kill* Must be used to drop the initial ref on a percpu refcount; must be called* precisely once before shutdown.* Switches @ref into atomic mode before gathering up the percpu counters
849  返回:0
调用者
名称描述
exit_aioxit_aio: called when the last user of mm goes away. At this point, there is* no way for any new requests to be submited or any of the io_* syscalls to be* called on the context.* There may be outstanding kiocbs, but free_ioctx() will explicitly wait on
SYSCALL_DEFINE2sys_io_setup:* Create an aio_context capable of receiving at least nr_events
COMPAT_SYSCALL_DEFINE2
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.