函数逻辑报告 |
Source Code:fs\iomap\direct-io.c |
Create Date:2022-07-29 11:07:47 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:map_dio_rw() always completes O_[D]SYNC writes regardless of whether the IO* is being issued as AIO or not. This allows us to optimise pure data writes* to use REQ_FUA rather than requiring generic_write_sync() to issue a* REQ_FLUSH post write
函数原型:ssize_t iomap_dio_rw(struct kiocb *iocb, struct iov_iter *iter, const struct iomap_ops *ops, const struct iomap_dio_ops *dops, bool wait_for_completion)
返回类型:ssize_t
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| struct kiocb * | iocb | |
| struct iov_iter * | iter | |
| const struct iomap_ops * | ops | |
| const struct iomap_dio_ops * | dops | |
| bool | wait_for_completion |
| 406 | inode等于file_inode(文件指针) |
| 407 | count等于iov_iter_count(iter) |
| 410 | flags等于direct I/O |
| 414 | lockdep_assert_held( & i_rwsem) |
| 416 | 如果非count则返回:0 |
| 419 | 如果WARN_ON(is_sync_kiocb(iocb) && !wait_for_completion)则返回:负EIO |
| 427 | atomic_set( & ref, 1) |
| 428 | size等于0 |
| 431 | error等于0 |
| 432 | flags等于0 |
| 436 | cookie等于BLK_QC_T_NONE |
| 437 | last_queue = NULL |
| 439 | 如果iov_iter_rw(iter)恒等于generic data direction definitions 则 |
| 440 | 如果pos大于等于i_size则转到:out_free_dio |
| 443 | 如果iter_is_iovec(iter)则flags或等于IOMAP_DIO_DIRTY |
| 445 | 否则 |
| 447 | flags或等于IOMAP_DIO_WRITE |
| 450 | 如果ki_flags按位与IOCB_DSYNC则flags或等于IOMAP_DIO_NEED_SYNC |
| 463 | 如果ki_flags按位与IOCB_NOWAIT则 |
| 466 | 转到:out_free_dio |
| 468 | flags或等于do not block |
| 472 | 如果ret则转到:out_free_dio |
| 485 | ret等于0 |
| 487 | 如果iov_iter_rw(iter)恒等于WRITE且非wait_for_completion且非s_dio_done_wq则 |
| 490 | 如果ret小于0则转到:out_free_dio |
| 494 | 允许I/O信号请求 |
| 496 | blk_start_plug( & plug) |
| 497 | 循环 |
| 498 | ret等于Execute a iomap write on a segment of the mapping that spans a* contiguous range of pages that have identical block mapping state |
| 500 | 如果ret小于等于0则 |
| 510 | 如果iov_iter_rw(iter)恒等于generic data direction definitions 且pos大于等于i_size则 |
| 516 | iov_iter_revert(iter, pos - i_size) |
| 517 | 退出 |
| 519 | 当count等于iov_iter_count(iter)大于0循环 |
| 520 | blk_finish_plug( & plug) |
| 522 | 如果ret小于0则Set an error in the dio if none is set yet. We have to use cmpxchg* as the submission context and the completion context(s) can race to* update the error. |
| 529 | 如果flags按位与Private flags for iomap_dio, must not overlap with the public ones in* iomap.h:则flags与等于IOMAP_DIO_NEED_SYNC的反 |
| 532 | WRITE_ONCE( for ->iopoll , cookie) |
| 533 | WRITE_ONCE(private, last_queue) |
| 551 | 如果非atomic_dec_and_test( & ref)则 |
| 555 | 循环 |
| 556 | set_current_state(深度睡眠态) |
| 560 | 如果非ki_flags按位与IOCB_HIPRI的值或非last_queue或非blk_poll(last_queue, cookie, true)则io_schedule() |
| 569 | 返回:iomap_dio_complete(dio) |
| 571 | out_free_dio : |
| 572 | 释放内存 |
| 573 | 返回:ret |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |