函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:io_uring_create

函数原型:static int io_uring_create(unsigned entries, struct io_uring_params *p)

返回类型:int

参数:

类型参数名称
unsignedentries
struct io_uring_params *p
5318  struct user_struct * user = NULL
5323  如果非entriesentries大于IORING_MAX_ENTRIES则返回:负EINVAL
5334  sq_entries等于undup_pow_of_two - round the given value up to nearest power of two*@n: parameter* round the given value up to the nearest power of two* - the result is undefined when n == 0* - this can be used to initialise global variables from constant data(entries)
5335  如果flags按位与app defines CQ size
5341  如果cq_entries小于sq_entriescq_entries大于IORING_MAX_CQ_ENTRIES则返回:负EINVAL
5343  cq_entries等于undup_pow_of_two - round the given value up to nearest power of two*@n: parameter* round the given value up to the nearest power of two* - the result is undefined when n == 0* - this can be used to initialise global variables from constant data(cq_entries)
5344  否则
5345  cq_entries等于2乘sq_entries
5348  user等于get_uid(current_user())
5349  account_mem等于非操作权限检查
5351  如果account_mem
5352  ret等于io_account_mem(user, ring_pages(sq_entries, cq_entries))
5354  如果ret
5355  free_uid(user)
5356  返回:ret
5360  ctx等于io_ring_ctx_alloc(p)
5361  如果非ctx
5362  如果account_memio_unaccount_mem(user, ring_pages(sq_entries, cq_entries))
5365  free_uid(user)
5366  返回:负ENOMEM
5368  compat等于in_compat_syscall()
5369  account_mem等于account_mem
5370  user等于user
5371  creds等于get_current_cred - Get the current task's subjective credentials* Get the subjective credentials of the current task, pinning them so that* they can't go away. Accessing the current task's credentials directly is* not permitted.()
5373  ret等于io_allocate_scq_urings(ctx, p)
5374  如果ret则转到:err
5377  ret等于io_sq_offload_start(ctx, p)
5378  如果ret则转到:err
5381  memset( & sq_off, 0, sq_off的长度)
5382  head等于offsetof(structio_rings, head)
5383  tail等于offsetof(structio_rings, tail)
5384  ring_mask等于offsetof(structio_rings, sq_ring_mask)
5385  ring_entries等于offsetof(structio_rings, sq_ring_entries)
5386  flags等于offsetof(structio_rings, sq_flags)
5387  dropped等于offsetof(structio_rings, sq_dropped)
5388  array等于* Ring buffer of indices into array of io_uring_sqe, which is * mmapped by the application using the IORING_OFF_SQES offset. * This indirection could e.g. be used to assign fixed * io_uring_sqe entries to operations and only submit them to * the queue whenrings
5390  memset( & cq_off, 0, cq_off的长度)
5391  head等于offsetof(structio_rings, head)
5392  tail等于offsetof(structio_rings, tail)
5393  ring_mask等于offsetof(structio_rings, cq_ring_mask)
5394  ring_entries等于offsetof(structio_rings, cq_ring_entries)
5395  overflow等于offsetof(structio_rings, cq_overflow)
5396  cqes等于offsetof(structio_rings, cqes)
5402  ret等于Allocate an anonymous fd, this is what constitutes the application* visible backing of an io_uring instance. The application mmaps this* fd to gain access to the SQ/CQ ring details. If UNIX sockets are enabled,
5403  如果ret小于0则转到:err
5406  features等于_uring_params->features flags按位或IORING_FEAT_NODROP按位或IORING_FEAT_SUBMIT_STABLE
5408  _uring_create - called after a new io_uring context was prepared*@fd: corresponding file descriptor*@ctx: pointer to a ring context structure*@sq_entries: actual SQ size*@cq_entries: actual CQ size*@flags: SQ ring flags, provided to io_uring_setup(2)*
5409  返回:ret
5410  err :
5411  io_ring_ctx_wait_and_kill(ctx)
5412  返回:ret
调用者
名称描述
io_uring_setupSets up an aio uring context, and returns the fd. Applications asks for a* ring size, we return the actual sq/cq ring sizes (among other things) in the* params structure passed in.