Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\io_uring.c Create Date:2022-07-28 20:22:09
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:io_get_req

Proto:static struct io_kiocb *io_get_req(struct io_ring_ctx *ctx, struct io_submit_state *state)

Type:struct io_kiocb

Parameter:

TypeParameterName
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  If Not 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. Then Return NULL
884  If Not state Then
885  req = kmem_cache_alloc(req_cachep, gfp)
886  If Value for the false possibility is greater at compile time(!req) Then Go to fallback
888  Else if Not free_reqs Then
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  If Not * io_kiocb alloc cache[0] Then Go to fallback
903  ret = 1
905  free_reqs = ret - 1
906  cur_req = 1
907  req = * io_kiocb alloc cache[0]
908  Else
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  Return req
925  fallback :
926  req = io_get_fallback_req(ctx)
927  If req Then Go to got_it
929  percpu_ref_put - decrement a percpu refcount*@ref: percpu_ref to put* Decrement the refcount, and if 0, call the release function (which was passed* to percpu_ref_init())* This function is safe to call as long as @ref is between init and exit.
930  Return NULL
Caller
NameDescribe
io_submit_sqes