函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:io_prep_rw

函数原型:static int io_prep_rw(struct io_kiocb *req, const struct io_uring_sqe *sqe, bool force_nonblock)

返回类型:int

参数:

类型参数名称
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  如果非file则返回:负EBADF
1508  如果S_ISREG(i_mode)则flags或等于gular file
1511  文件偏移等于READ_ONCE(ffset into file )
1512  ki_flags等于iocb_flags(文件指针)
1513  ki_hint等于ki_hint_validate(file_write_hint(文件指针))
1515  ioprio等于READ_ONCE(prio for the request )
1516  如果ioprio
1517  ret等于ioprio_check_cap(ioprio)
1518  如果ret则返回:ret
1521  See linux/ioprio.h 等于ioprio
1522  否则 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  如果此条件成立可能性小(为编译器优化)(ret)则返回:ret
1530  如果ki_flags按位与IOCB_NOWAITf_flags按位与O_NONBLOCKflags或等于must not punt to workers
1534  如果force_nonblockki_flags或等于IOCB_NOWAIT
1537  如果flags按位与_context is polled
1538  如果非ki_flags按位与IOCB_DIRECT的值或非iopoll则返回:负EOPNOTSUPP
1542  ki_flags或等于IOCB_HIPRI
1543  ki_complete等于io_complete_rw_iopoll
1544  result等于0
1545  否则
1546  如果ki_flags按位与IOCB_HIPRI则返回:负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  返回:0
调用者
名称描述
io_read_prep
io_write_prep