函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:io_ring_ctx_alloc

函数原型:static struct io_ring_ctx *io_ring_ctx_alloc(struct io_uring_params *p)

返回类型:struct io_ring_ctx

参数:

类型参数名称
struct io_uring_params *p
505  ctx等于分配内存并置零
506  如果非ctx则返回:NULL
509  if all else fails... 等于分配高速缓存区
510  如果非 if all else fails... 则转到:err
513  0 is for ctx quiesce/reinit/free, 1 is for sqo_thread started 等于开辟内存
514  如果非 0 is for ctx quiesce/reinit/free, 1 is for sqo_thread started 则转到:err
521  hash_bits等于log2 - log base 2 of 32-bit or a 64-bit unsigned value*@n: parameter* constant-capable log of base 2 calculation* - this can be used to initialise global variables from constant data, hence* the massive ternary operator construction* selects the (cq_entries)
522  hash_bits减等于5
523  如果hash_bits小于等于0则hash_bits等于1
525  cancel_hash_bits等于hash_bits
526  cancel_hash等于开辟内存
528  如果非cancel_hash则转到:err
530  __hash_init(cancel_hash, 1U << hash_bits)
532  如果percpu_ref_init - initialize a percpu refcount*@ref: percpu_ref to initialize*@release: function which will be called when refcount hits 0*@flags: PERCPU_REF_INIT_* flags*@gfp: allocation mask to use* Initializes @ref则转到:err
536  flags等于flags
537  init_waitqueue_head( & cq_wait)
538  初始化链表头
539  init_completion( & 0 is for ctx quiesce/reinit/free, 1 is for sqo_thread started [0])
540  init_completion( & 0 is for ctx quiesce/reinit/free, 1 is for sqo_thread started [1])
541  mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & uring_lock)
542  init_waitqueue_head( & wait)
543  spin_lock_init( & completion_lock)
544  初始化链表头
545  初始化链表头
546  初始化链表头
547  init_waitqueue_head( & inflight_wait)
548  spin_lock_init( & inflight_lock)
549  初始化链表头
550  返回:ctx
551  err :
552  如果 if all else fails... kmem_cache_free(req_cachep, if all else fails... )
554  释放内存
555  释放内存
556  释放内存
557  返回:NULL
调用者
名称描述
io_uring_create