函数逻辑报告 |
Source Code:mm\migrate.c |
Create Date:2022-07-27 17:32:54 |
| Last Modify:2022-05-20 09:53:13 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称:__buffer_migrate_page
函数原型:static int __buffer_migrate_page(struct address_space *mapping, struct page *newpage, struct page *page, enum migrate_mode mode, bool check_refs)
返回类型:int
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| struct address_space * | mapping | |
| struct page * | newpage | |
| struct page * | page | |
| enum migrate_mode | mode | |
| bool | check_refs |
| 744 | 如果非page_has_buffers(page)则返回:Common logic to directly migrate a single LRU page suitable for* pages that do not use PagePrivate/PagePrivate2.* Pages are locked upon entry and exit. |
| 749 | 如果page_count(page)不等于expected_count则返回:负EAGAIN |
| 756 | 如果check_refs则 |
| 758 | bool invalidated = false |
| 760 | recheck_buffers : |
| 761 | busy = false |
| 762 | 加自旋锁 |
| 764 | 循环 |
| 765 | 如果atomic_read( & users using this buffer_head )则 |
| 771 | 如果busy则 |
| 772 | 如果invalidated则 |
| 774 | 转到:unlock_buffers |
| 776 | 自旋锁解锁 |
| 777 | invalidate_bh_lrus() |
| 778 | invalidated = true |
| 779 | 转到:recheck_buffers |
| 784 | 如果rc不等于Return values from addresss_space_operations.migratepage():* - negative errno on page migration failure;* - zero on page migration success;则转到:unlock_buffers |
| 788 | set_page_private(newpage, page_private(page)) |
| 789 | set_page_private(page, 0) |
| 794 | 循环 |
| 795 | set_bh_page(bh, newpage, bh_offset(bh)) |
| 802 | 如果mode不等于MIGRATE_SYNC_NO_COPY则migrate_page_copy(newpage, page) |
| 807 | rc等于Return values from addresss_space_operations.migratepage():* - negative errno on page migration failure;* - zero on page migration success; |
| 808 | unlock_buffers : |
| 809 | 如果check_refs则自旋锁解锁 |
| 812 | 循环 |
| 813 | unlock_buffer(bh) |
| 818 | 返回:rc |
| 名称 | 描述 |
|---|---|
| buffer_migrate_page | Migration function for pages with buffers. This function can only be used* if the underlying filesystem guarantees that no other references to "page"* exist. For example attached buffer heads are accessed only under page lock. |
| buffer_migrate_page_norefs | Same as above except that this variant is more careful and checks that there* are also no buffer head references. This function is the right one for* mappings where buffer heads are directly looked up and referenced (such as* block device mappings). |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |