函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\filemap.c Create Date:2022-07-27 15:26:16
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:generic_file_direct_write

函数原型:ssize_t generic_file_direct_write(struct kiocb *iocb, struct iov_iter *from)

返回类型:ssize_t

参数:

类型参数名称
struct kiocb *iocb
struct iov_iter *from
3167  file等于文件指针
3168  mapping等于f_mapping
3169  inode等于host
3170  pos等于文件偏移
3175  write_len等于iov_iter_count(from)
3176  end等于poswrite_len减1右移PAGE_SHIFT determines the page size
3178  如果ki_flags按位与IOCB_NOWAIT
3180  如果lemap_range_has_page - check if a page exists in range则返回:负EAGAIN
3183  否则
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  如果written则转到: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  如果written
3203  如果written恒等于负EBUSY则返回:0
3205  转到:out
3208  written等于direct_IO(iocb, from)
3227  如果written大于0且nrpagesvalidate_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 Warn about a page cache invalidation failure during a direct I/O write.
3231  如果written大于0则
3232  pos加等于written
3233  write_len减等于written
3238  文件偏移等于pos
3240  iov_iter_revert(from, write_len - iov_iter_count(from))
3241  out :
3242  返回:written
调用者
名称描述
__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