Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:io_issue_sqe

Proto:static int io_issue_sqe(struct io_kiocb *req, const struct io_uring_sqe *sqe, struct io_kiocb **nxt, bool force_nonblock)

Type:int

Parameter:

TypeParameterName
struct io_kiocb *req
const struct io_uring_sqe *sqe
struct io_kiocb **nxt
boolforce_nonblock
3184  ctx = ctx
3188  Case opcode == IORING_OP_NOP
3189  ret = IORING_OP_NOP just posts a completion event, nothing else.
3190  Break
3191  Case opcode == IORING_OP_READV
3192  Case opcode == IORING_OP_READ_FIXED
3193  If sqe Then
3195  If ret < 0 Then Break
3198  ret = io_read(req, nxt, force_nonblock)
3199  Break
3200  Case opcode == IORING_OP_WRITEV
3201  Case opcode == IORING_OP_WRITE_FIXED
3202  If sqe Then
3204  If ret < 0 Then Break
3207  ret = io_write(req, nxt, force_nonblock)
3208  Break
3209  Case opcode == IORING_OP_FSYNC
3210  If sqe Then
3211  ret = io_prep_fsync(req, sqe)
3212  If ret < 0 Then Break
3215  ret = io_fsync(req, nxt, force_nonblock)
3216  Break
3217  Case opcode == IORING_OP_POLL_ADD
3218  If sqe Then
3220  If ret Then Break
3223  ret = io_poll_add(req, nxt)
3224  Break
3225  Case opcode == IORING_OP_POLL_REMOVE
3226  If sqe Then
3228  If ret < 0 Then Break
3231  ret = Find a running poll command that matches one specified in sqe->addr,* and remove it if found.
3232  Break
3233  Case opcode == IORING_OP_SYNC_FILE_RANGE
3234  If sqe Then
3235  ret = io_prep_sfr(req, sqe)
3236  If ret < 0 Then Break
3239  ret = io_sync_file_range(req, nxt, force_nonblock)
3240  Break
3241  Case opcode == IORING_OP_SENDMSG
3242  If sqe Then
3243  ret = io_sendmsg_prep(req, sqe)
3244  If ret < 0 Then Break
3247  ret = io_sendmsg(req, nxt, force_nonblock)
3248  Break
3249  Case opcode == IORING_OP_RECVMSG
3250  If sqe Then
3251  ret = io_recvmsg_prep(req, sqe)
3252  If ret Then Break
3255  ret = io_recvmsg(req, nxt, force_nonblock)
3256  Break
3257  Case opcode == IORING_OP_TIMEOUT
3258  If sqe Then
3259  ret = io_timeout_prep(req, sqe, false)
3260  If ret Then Break
3263  ret = io_timeout(req)
3264  Break
3265  Case opcode == IORING_OP_TIMEOUT_REMOVE
3266  If sqe Then
3268  If ret Then Break
3271  ret = Remove or update an existing timeout command
3272  Break
3273  Case opcode == IORING_OP_ACCEPT
3274  If sqe Then
3275  ret = io_accept_prep(req, sqe)
3276  If ret Then Break
3279  ret = io_accept(req, nxt, force_nonblock)
3280  Break
3281  Case opcode == IORING_OP_CONNECT
3282  If sqe Then
3283  ret = io_connect_prep(req, sqe)
3284  If ret Then Break
3287  ret = io_connect(req, nxt, force_nonblock)
3288  Break
3289  Case opcode == IORING_OP_ASYNC_CANCEL
3290  If sqe Then
3292  If ret Then Break
3295  ret = io_async_cancel(req, nxt)
3296  Break
3297  Default
3298  ret = -EINVAL
3299  Break
3302  If ret Then Return ret
3305  If flags & _context is polled Then
3306  in_async = io_wq_current_is_worker()
3308  If result == -EAGAIN Then Return -EAGAIN
3312  If in_async Then mutex_lock( & uring_lock)
3315  After the iocb has been issued, it's safe to be found on the poll list.* Adding the kiocb to the list AFTER submission ensures that we don't* find it from a io_iopoll_getevents() thread before the issuer is done* accessing the kiocb cookie.
3317  If in_async Then mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
3321  Return 0
Caller
NameDescribe
io_wq_submit_work
__io_queue_sqe