函数逻辑报告 |
Source Code:mm\page_io.c |
Create Date:2022-07-27 16:43:57 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:generic_swapfile_activate
函数原型:int generic_swapfile_activate(struct swap_info_struct *sis, struct file *swap_file, sector_t *span)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct swap_info_struct * | sis | |
struct file * | swap_file | |
sector_t * | span |
158 | lowest_block等于负1 |
159 | highest_block等于0 |
160 | nr_extents等于0 |
164 | blocks_per_page等于PAGE_SIZE右移blkbits位 |
170 | probe_block等于0 |
171 | page_no等于0 |
178 | cond_resched() |
180 | first_block等于查找文件中的块号 |
181 | 如果first_block恒等于0则转到:bad_bmap |
187 | 如果first_block按位与blocks_per_page减1则 |
188 | probe_block自加 |
189 | 转到:reprobe |
199 | 如果block不等于first_block加block_in_page则 |
201 | probe_block自加 |
202 | 转到:reprobe |
207 | 如果page_no则 |
217 | ret等于Add a block range (and the corresponding page range) into this swapdev's* extent tree.* This function rather assumes that it is called in ascending page order. |
220 | nr_extents加等于ret |
221 | page_no自加 |
222 | probe_block加等于blocks_per_page |
223 | reprobe : |
224 | 继续下一循环 |
226 | ret等于nr_extents |
227 | span等于1加highest_block减lowest_block |
230 | xtent of the swap_map 等于page_no |
231 | al of usable pages of swap 等于page_no减1 |
232 | dex of last free in swap_map 等于page_no减1 |
233 | out : |
234 | 返回:ret |
235 | bad_bmap : |
236 | 打印错误信息("swapon: swapfile has holes\n") |
238 | 转到:out |
名称 | 描述 |
---|---|
setup_swap_extents | A `swap extent' is a simple thing which maps a contiguous range of pages* onto a contiguous range of disk blocks. An ordered list of swap extents* is built at swapon time and is then used at swap_writepage/swap_readpage |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |