Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:io_prep_rw

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

Type:int

Parameter:

TypeParameterName
struct io_kiocb *req
const struct io_uring_sqe *sqe
boolforce_nonblock
1500  ctx = ctx
1501  kiocb = NOTE: kiocb has the file as the first member, so don't do it here
1505  If Not file Then Return -EBADF
1508  If S_ISREG(i_mode) Then flags |= gular file
1511  The 'ki_filp' pointer is shared in a union for aio = READ_ONCE(ffset into file )
1512  ki_flags = iocb_flags(ki_filp)
1513  ki_hint = ki_hint_validate(file_write_hint(ki_filp))
1515  ioprio = READ_ONCE(prio for the request )
1516  If ioprio Then
1517  ret = ioprio_check_cap(ioprio)
1518  If ret Then Return ret
1521  See linux/ioprio.h = ioprio
1522  Else See linux/ioprio.h = If the calling process has set an I/O priority, use that. Otherwise, return* the default I/O priority.
1525  ret = kiocb_set_rw_flags(kiocb, READ_ONCE(rw_flags))
1526  If Value for the false possibility is greater at compile time(ret) Then Return ret
1530  If ki_flags & IOCB_NOWAIT || f_flags & O_NONBLOCK Then flags |= must not punt to workers
1534  If force_nonblock Then ki_flags |= IOCB_NOWAIT
1537  If flags & _context is polled Then
1538  If Not (ki_flags & IOCB_DIRECT) || Not iopoll Then Return -EOPNOTSUPP
1542  ki_flags |= IOCB_HIPRI
1543  ki_complete = io_complete_rw_iopoll
1544  result = 0
1545  Else
1546  If ki_flags & IOCB_HIPRI Then Return -EINVAL
1548  ki_complete = io_complete_rw
1551  addr = READ_ONCE(pointer to buffer or iovecs )
1552  len = READ_ONCE(uffer size or number of iovecs )
1554  private = READ_ONCE(dex into fixed buffers, if used )
1556  Return 0
Caller
NameDescribe
io_read_prep
io_write_prep