函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:dio_complete() - called when all DIO BIO I/O has been completed* This drops i_dio_count, lets interested parties know that a DIO operation* has completed, and calculates the resulting return code for the operation

函数原型:static ssize_t dio_complete(struct dio *dio, ssize_t ret, unsigned int flags)

返回类型:ssize_t

参数:

类型参数名称
struct dio *dio
ssize_tret
unsigned intflags
238  offset等于文件偏移
239  transferred等于0
248  如果ret恒等于负cb queued, will get completion event ret等于0
251  如果IO result
252  transferred等于IO result
255  如果op恒等于REQ_OP_READoffsettransferred大于_size when submitted transferred等于_size when submitted offset
259  如果此条件成立可能性小(为编译器优化)(ret == - EFAULT)且transferredret等于0
263  如果ret恒等于0则ret等于 from get_user_pages()
265  如果ret恒等于0则ret等于IO error in completion path
267  如果ret恒等于0则ret等于transferred
270  如果IO completion function
272  err等于IO completion function (kiocb , offset, ret, copy from map_bh.b_private )
273  如果errret等于err
289  如果flags按位与Can invalidate pages ret大于0且op恒等于REQ_OP_WRITEnrpages
292  err等于validate_inode_pages2_range - remove range of pages from an address_space*@mapping: the address_space*@start: the page offset 'from' which to invalidate*@end: the page offset 'to' which to invalidate (inclusive)* Any pages which are found to be mapped
295  如果errWarn about a page cache invalidation failure during a direct I/O write.
299  结束I/O信号请求
301  如果flags按位与This is async IO
307  文件偏移加等于transferred
309  如果ret大于0且op恒等于REQ_OP_WRITEret等于Sync the bytes written if this was a synchronous write. Expect ki_pos* to already be updated for the write, and will return either the amount* of bytes passed in, or an error if syncing the file failed.
311  ki_complete(kiocb , ret, 0)
314  kmem_cache_free(dio_cache, dio)
315  返回:ret
调用者
名称描述
dio_aio_complete_work
dio_bio_end_aioAsynchronous IO callback.
do_blockdev_direct_IOThis is a library function for use by filesystem drivers