函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:io_sqe_files_register

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

返回类型:int

参数:

类型参数名称
struct io_ring_ctx *ctx
void __user *arg
unsignednr_args
4282  __userfds等于arg
4284  ret等于0
4287  如果* 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).则返回:负EBUSY
4289  如果非nr_args则返回:负EINVAL
4291  如果nr_args大于IORING_MAX_FIXED_FILES则返回:负EMFILE
4294  nr_tables等于DIV_ROUND_UP(nr_args, IORING_MAX_FILES_TABLE)
4295  * 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).等于分配数组内存并置零
4297  如果非* 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).则返回:负ENOMEM
4300  如果io_sqe_alloc_file_tables(ctx, nr_tables, nr_args)则
4301  释放内存
4302  * 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). = NULL
4303  返回:负ENOMEM
4306 i小于nr_args循环
4310  ret等于负EFAULT
4311  如果copy_from_user( & fd, & fds[i], fd的长度)则退出
4314  如果fd恒等于负1则
4315  ret等于0
4316  继续下一循环
4319  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]
4320  index等于i按位与IORING_FILE_TABLE_MASK
4321  files[index]等于fget(fd)
4323  ret等于负EBADF
4324  如果非files[index]则退出
4333  如果f_op恒等于io_uring_fops
4334  fput(files[index])
4335  退出
4337  ret等于0
4340  如果ret
4341 i小于nr_user_files循环
4344  file等于io_file_from_index(ctx, i)
4345  如果filefput(file)
4348 i小于nr_tables循环释放内存
4351  释放内存
4352  * 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). = NULL
4353  nr_user_files等于0
4354  返回:ret
4357  ret等于io_sqe_files_scm(ctx)
4358  如果retio_sqe_files_unregister(ctx)
4361  返回:ret
调用者
名称描述
__io_uring_register