函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:io_get_req

函数原型:static struct io_kiocb *io_get_req(struct io_ring_ctx *ctx, struct io_submit_state *state)

返回类型:struct io_kiocb

参数:

类型参数名称
struct io_ring_ctx *ctx
struct io_submit_state *state
878  gfp等于GFP_KERNEL按位或DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success.
881  如果非percpu_ref_tryget - try to increment a percpu refcount*@ref: percpu_ref to try-get* Increment a percpu refcount unless its count already reached zero.* Returns %true on success; %false on failure.则返回:NULL
884  如果非state
885  req等于分配高速缓存区
886  如果此条件成立可能性小(为编译器优化)(!req)则转到:fallback
888  否则如果非free_reqs
892  sz等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(size_t, ios_left, ARRAY_SIZE - get the number of elements in array @arr*@arr: array to be sized(* io_kiocb alloc cache))
893  ret等于kmem_cache_alloc_bulk(req_cachep, gfp, sz, * io_kiocb alloc cache)
901  如果非* io_kiocb alloc cache[0]则转到:fallback
903  ret等于1
905  free_reqs等于ret减1
906  cur_req等于1
907  req等于* io_kiocb alloc cache[0]
908  否则
909  req等于* io_kiocb alloc cache[cur_req]
910  free_reqs自减
911  cur_req自加
914  got_it :
915  io = NULL
916  ring_file = NULL
917  file = NULL
918  ctx等于ctx
919  flags等于0
921  _set - set a refcount's value*@r: the refcount*@n: value to which the refcount will be set
922  result等于0
923  INIT_IO_WORK( & work, io_wq_submit_work)
924  返回:req
925  fallback :
926  req等于io_get_fallback_req(ctx)
927  如果req则转到:got_it
929  percpu计数引用减
930  返回:NULL
调用者
名称描述
io_submit_sqes