函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:io_sqe_files_update

函数原型:static int io_sqe_files_update(struct io_ring_ctx *ctx, void __user *arg, unsigned nr_args)

返回类型:int

参数:

类型参数名称
struct io_ring_ctx *ctx
void __user *arg
unsignednr_args
4474  __userfds
4478  如果非* 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).则返回:负ENXIO
4480  如果非nr_args则返回:负EINVAL
4482  如果copy_from_user( & up, arg, up的长度)则返回:负EFAULT
4484  如果resv则返回:负EINVAL
4486  如果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)则返回:负EOVERFLOW
4488  如果done大于nr_user_files则返回:负EINVAL
4491  done等于0
4492  fds等于u64_to_user_ptr( __s32 * )
4493 nr_args循环
4497  err等于0
4498  如果copy_from_user( & fd, & fds[done], fd的长度)则
4499  err等于负EFAULT
4500  退出
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  如果files[index]则
4507  files[index] = NULL
4509  如果fd不等于负1则
4512  file等于fget(fd)
4513  如果非file
4514  err等于负EBADF
4515  退出
4525  如果f_op恒等于io_uring_fops
4526  fput(file)
4527  err等于负EBADF
4528  退出
4530  files[index]等于file
4531  err等于io_sqe_file_register(ctx, file, i)
4532  如果err退出
4535  nr_args自减
4536  done自加
4537  offset自加
4540  返回:如果donedone否则err
调用者
名称描述
__io_uring_register