Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:io_sqe_files_update

Proto:static int io_sqe_files_update(struct io_ring_ctx *ctx, void __user *arg, unsigned nr_args)

Type:int

Parameter:

TypeParameterName
struct io_ring_ctx *ctx
void __user *arg
unsignednr_args
4474  __user * fds
4478  If Not * If used, fixed file set. Writers must ensure that ->refs is dead, * readers must ensure that ->refs is alive as long as the file* is * used. Only updated through io_uring_register(2). Then Return -ENXIO
4480  If Not nr_args Then Return -EINVAL
4482  If copy_from_user( & up, arg, size of up ) Then Return -EFAULT
4484  If resv Then Return -EINVAL
4486  If For simplicity and code hygiene, the fallback code below insists on* a, b and *d having the same type (similar to the min() and max()* macros), whereas gcc's type-generic overflow checkers accept* different types(offset, nr_args, & done) Then Return -EOVERFLOW
4488  If done > nr_user_files Then Return -EINVAL
4491  done = 0
4492  fds = u64_to_user_ptr( __s32 * )
4493  When nr_args cycle
4497  err = 0
4498  If copy_from_user( & fd, & fds[done], size of fd ) Then
4499  err = -EFAULT
4500  Break
4502  i = 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];* }* (offset, nr_user_files)
4503  table = * If used, fixed file set. Writers must ensure that ->refs is dead, * readers must ensure that ->refs is alive as long as the file* is * used. Only updated through io_uring_register(2).[i >> Shift of 9 is 512 entries, or exactly one page on 64-bit archs]
4504  index = i & IORING_FILE_TABLE_MASK
4505  If files[index] Then
4507  files[index] = NULL
4509  If fd != -1 Then
4512  file = fget(fd)
4513  If Not file Then
4514  err = -EBADF
4515  Break
4525  If f_op == io_uring_fops Then
4526  fput(file)
4527  err = -EBADF
4528  Break
4530  files[index] = file
4532  If err Then Break
4535  nr_args--
4536  done++
4537  offset++
4540  Return If done Then done Else err
Caller
NameDescribe
__io_uring_register