函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\migrate.c Create Date:2022-07-27 17:32:47
Last Modify:2022-05-20 09:53:13 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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.

函数原型:int migrate_page(struct address_space *mapping, struct page *newpage, struct page *page, enum migrate_mode mode)

返回类型:int

参数:

类型参数名称
struct address_space *mapping
struct page *newpage
struct page *page
enum migrate_modemode
682  BUG_ON(Only test-and-set exist for PG_writeback. The unconditional operators are* risky: they bypass page accounting.)
684  rc等于Replace the page in the mapping.* The number of remaining references must be:* 1 for anonymous pages without a mapping* 2 for pages with a mapping* 3 for pages with a mapping and PagePrivate/PagePrivate2 set.
686  如果rc不等于Return values from addresss_space_operations.migratepage():* - negative errno on page migration failure;* - zero on page migration success;则返回:rc
689  如果mode不等于MIGRATE_SYNC_NO_COPYmigrate_page_copy(newpage, page)
691  否则Copy the page to its new location
693  返回:Return values from addresss_space_operations.migratepage():* - negative errno on page migration failure;* - zero on page migration success;
调用者
名称描述
__buffer_migrate_page
fallback_migrate_pageDefault handling if a filesystem does not provide a migration function.
move_to_new_pageMove a page to a newly allocated page* The page is locked and all ptes have been successfully removed.* The new page will have replaced the old page if this function* is successful.* Return value:* < 0 - error code* MIGRATEPAGE_SUCCESS - success