Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:io_req_set_file

Proto:static int io_req_set_file(struct io_submit_state *state, struct io_kiocb *req, const struct io_uring_sqe *sqe)

Type:int

Parameter:

TypeParameterName
struct io_submit_state *state
struct io_kiocb *req
const struct io_uring_sqe *sqe
3398  ctx = ctx
3402  flags = READ_ONCE(IOSQE_ flags )
3403  fd = READ_ONCE(le descriptor to do IO on )
3405  If flags & ssue after inflight IO Then flags |= drain existing IO first
3408  ret = io_req_needs_file(req)
3409  If ret <= 0 Then Return ret
3412  If flags & use fixed fileset Then
3413  If Value for the false possibility is greater at compile time(!* 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). || (unsigned)fd >= nr_user_files) Then Return -EBADF
3416  fd = array_index_nospec - sanitize an array index after a bounds check* For a code sequence like:* if (index < size) {* index = array_index_nospec(index, size);* val = array[index];* }* (fd, nr_user_files)
3417  file = io_file_from_index(ctx, fd)
3418  If Not file Then Return -EBADF
3420  flags |= ctx owns file
3421  Else
3422  If needs_fixed_file Then Return -EBADF
3424  _uring_file_get - called before getting references to an SQE file*@ctx: pointer to a ring context structure*@fd: SQE file descriptor* Allows to trace out how often an SQE file reference is obtained, which can* help figuring out if it makes sense to use
3425  file = Get as many references to a file as we have IOs left in this submission,* assuming most submissions are for one file, or at least that each file* has more than one submission.
3426  If Value for the false possibility is greater at compile time(!file) Then Return -EBADF
3430  Return 0
Caller
NameDescribe
io_submit_sqe