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: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.

Proto:static int kill_ioctx(struct mm_struct *mm, struct kioctx *ctx, struct ctx_rq_wait *wait)

Type:int

Parameter:

TypeParameterName
struct mm_struct *mm
struct kioctx *ctx
struct ctx_rq_wait *wait
821  spin_lock( & ioctx_lock)
822  If atomic_xchg( & dead, 1) Then
823  spin_unlock( & ioctx_lock)
824  Return -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  spin_unlock( & ioctx_lock)
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  If mmap_size Then vm_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  Return 0
Caller
NameDescribe
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.