函数逻辑报告 |
Source Code:mm\filemap.c |
Create Date:2022-07-27 15:25:11 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:generic_file_buffered_read - generic file read routine*@iocb: the iocb to read*@iter: data destination*@written: already copied* This is a generic file read routine, and uses the* mapping->a_ops->readpage() function for the actual low-level stuff.
函数原型:static ssize_t generic_file_buffered_read(struct kiocb *iocb, struct iov_iter *iter, ssize_t written)
返回类型:ssize_t
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| struct kiocb * | iocb | |
| struct iov_iter * | iter | |
| ssize_t | written |
| 2022 | error等于0 |
| 2024 | 如果此条件成立可能性小(为编译器优化)( * ppos >= s_maxbytes)则返回:0 |
| 2028 | index等于ppos右移PAGE_SHIFT determines the page size 位 |
| 2030 | prev_offset等于Cache last read() position 按位与PAGE_SIZE减1 |
| 2034 | 循环 |
| 2040 | cond_resched() |
| 2041 | find_page : |
| 2042 | 如果fatal_signal_pending(当前进程)则 |
| 2048 | 如果非page则 |
| 2049 | 如果ki_flags按位与IOCB_NOWAIT则转到:would_block |
| 2051 | page_cache_sync_readahead(mapping, ra, filp, index, last_index - index) |
| 2055 | 如果此条件成立可能性小(为编译器优化)(page == NULL)则转到:no_cached_page |
| 2058 | 如果PageReadahead(page)则 |
| 2059 | page_cache_async_readahead(mapping, ra, filp, page, index, last_index - index) |
| 2063 | 如果非PageUptodate(page)则 |
| 2064 | 如果ki_flags按位与IOCB_NOWAIT则 |
| 2066 | 转到:would_block |
| 2075 | 如果此条件成立可能性小(为编译器优化)(error)则转到:readpage_error |
| 2077 | 如果PageUptodate(page)则转到:page_ok |
| 2080 | 如果i_blkbits恒等于PAGE_SHIFT determines the page size 或非is_partially_uptodate则转到:page_not_up_to_date |
| 2084 | 如果此条件成立可能性小(为编译器优化)(iov_iter_is_pipe(iter))则转到:page_not_up_to_date |
| 2091 | 如果非is_partially_uptodate(page, offset, count)则转到:page_not_up_to_date_locked |
| 2096 | page_ok : |
| 2107 | end_index等于isize减1右移PAGE_SHIFT determines the page size 位 |
| 2108 | 如果此条件成立可能性小(为编译器优化)(!isize || index > end_index)则 |
| 2135 | 如果prev_index不等于index或offset不等于prev_offset则mark_page_accessed(page) |
| 2137 | prev_index等于index |
| 2146 | index加等于offset右移PAGE_SHIFT determines the page size 位 |
| 2148 | prev_offset等于offset |
| 2152 | 如果非iov_iter_count(iter)则转到:out |
| 2158 | 继续下一循环 |
| 2160 | page_not_up_to_date : |
| 2162 | error等于lock_page_killable is like lock_page but can be interrupted by fatal* signals. It returns 0 if it locked the page and -EINTR if it was* killed while waiting. |
| 2163 | 如果此条件成立可能性小(为编译器优化)(error)则转到:readpage_error |
| 2166 | page_not_up_to_date_locked : |
| 2168 | 如果非 See page-flags.h for PAGE_MAPPING_FLAGS 则 |
| 2171 | 继续下一循环 |
| 2175 | 如果PageUptodate(page)则 |
| 2177 | 转到:page_ok |
| 2180 | readpage : |
| 2186 | ClearPageError(page) |
| 2190 | 如果此条件成立可能性小(为编译器优化)(error)则 |
| 2191 | 如果error恒等于AOP_TRUNCATED_PAGE则 |
| 2196 | 转到:readpage_error |
| 2199 | 如果非PageUptodate(page)则 |
| 2200 | error等于lock_page_killable is like lock_page but can be interrupted by fatal* signals. It returns 0 if it locked the page and -EINTR if it was* killed while waiting. |
| 2201 | 如果此条件成立可能性小(为编译器优化)(error)则转到:readpage_error |
| 2203 | 如果非PageUptodate(page)则 |
| 2220 | 转到:page_ok |
| 2222 | readpage_error : |
| 2225 | 转到:out |
| 2227 | no_cached_page : |
| 2232 | page等于page_cache_alloc(mapping) |
| 2233 | 如果非page则 |
| 2237 | error等于add_to_page_cache_lru(page, mapping, index, Restricts the given gfp_mask to what the mapping allows. ) |
| 2239 | 如果error则 |
| 2247 | 转到:readpage |
| 2250 | would_block : |
| 2252 | out : |
| 2257 | ppos等于index左移PAGE_SHIFT determines the page size 位的值加offset |
| 2258 | file_accessed(filp) |
| 名称 | 描述 |
|---|---|
| generic_file_read_iter | generic_file_read_iter - generic filesystem read routine*@iocb: kernel I/O control block*@iter: destination for the data read* This is the "read_iter()" routine for all filesystems* that can use the page cache directly |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |