Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:static ssize_t dio_complete(struct dio *dio, ssize_t ret, unsigned int flags)

Type:ssize_t

Parameter:

TypeParameterName
struct dio *dio
ssize_tret
unsigned intflags
238  offset = The 'ki_filp' pointer is shared in a union for aio
239  transferred = 0
248  If ret == -cb queued, will get completion event Then ret = 0
251  If IO result Then
252  transferred = IO result
255  If op == REQ_OP_READ && offset + transferred > _size when submitted Then transferred = _size when submitted - offset
259  If Value for the false possibility is greater at compile time(ret == - EFAULT) && transferred Then ret = 0
263  If ret == 0 Then ret = from get_user_pages()
265  If ret == 0 Then ret = IO error in completion path
267  If ret == 0 Then ret = transferred
270  If IO completion function Then
272  err = IO completion function (kiocb , offset, ret, copy from map_bh.b_private )
273  If err Then ret = err
289  If flags & Can invalidate pages && ret > 0 && op == REQ_OP_WRITE && nrpages Then
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  If err Then Warn about a page cache invalidation failure during a direct I/O write.
299  de_dio_end - signal finish of a direct I/O requests*@inode: inode the direct I/O happens on* This is called once we've finished processing a direct I/O request,* and is used to wake up callers waiting for direct I/O to be quiesced.
301  If flags & This is async IO Then
307  The 'ki_filp' pointer is shared in a union for aio += transferred
309  If ret > 0 && op == REQ_OP_WRITE Then ret = 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  Return ret
Caller
NameDescribe
dio_aio_complete_work
dio_bio_end_aioAsynchronous IO callback.
do_blockdev_direct_IOThis is a library function for use by filesystem drivers