Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:generic_file_direct_write

Proto:ssize_t generic_file_direct_write(struct kiocb *iocb, struct iov_iter *from)

Type:ssize_t

Parameter:

TypeParameterName
struct kiocb *iocb
struct iov_iter *from
3167  file = ki_filp
3168  mapping = f_mapping
3169  inode = host
3170  pos = The 'ki_filp' pointer is shared in a union for aio
3175  write_len = iov_iter_count(from)
3176  end = pos + write_len - 1 >> PAGE_SHIFT determines the page size
3178  If ki_flags & IOCB_NOWAIT Then
3180  If lemap_range_has_page - check if a page exists in range Then Return -EAGAIN
3183  Else
3184  written = lemap_write_and_wait_range - write out & wait on a file range*@mapping: the address_space for the pages*@lstart: offset in bytes where the range starts*@lend: offset in bytes where the range ends (inclusive)
3186  If written Then Go to out
3196  written = 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
3202  If written Then
3203  If written == -EBUSY Then Return 0
3205  Go to out
3208  written = direct_IO(iocb, from)
3227  If written > 0 && nrpages && 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 Then Warn about a page cache invalidation failure during a direct I/O write.
3231  If written > 0 Then
3232  pos += written
3233  write_len -= written
3238  The 'ki_filp' pointer is shared in a union for aio = pos
3240  iov_iter_revert(from, write_len - iov_iter_count(from))
3241  out :
3242  Return written
Caller
NameDescribe
__generic_file_write_iter__generic_file_write_iter - write data to a file*@iocb: IO state structure (file, offset, etc.)*@from: iov_iter with data to write* This function does all the work needed for actually writing data to a* file