| Function report | 
| Source Code: mm\swap_state.c | Create Date:2022-07-28 15:14:28 | 
| Last Modify:2020-03-17 22:02:06 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:add_to_swap_cache resembles add_to_page_cache_locked on swapper_space,* but sets SwapCache flag and private instead of mapping and index.
Proto:int add_to_swap_cache(struct page *page, swp_entry_t entry, gfp_t gfp)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct page * | page | |
| swp_entry_t | entry | |
| gfp_t | gfp | 
| 116 | address_space = swap_address_space(entry) | 
| 117 | idx = Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format | 
| 121 | VM_BUG_ON_PAGE(!PageLocked(page), page) | 
| 122 | VM_BUG_ON_PAGE(PageSwapCache(page), page) | 
| 123 | VM_BUG_ON_PAGE(!PageSwapBacked(page), page) | 
| 125 | page_ref_add(page, nr) | 
| 126 | SetPageSwapCache(page) | 
| 128 | Do | 
| 129 | xas_lock_irq( & xas) | 
| 131 | If xas_error() - Return an errno stored in the xa_state.*@xas: XArray operation state.* Return: 0 if no error has been noted. A negative errno if one has. Then Go to unlock | 
| 134 | VM_BUG_ON_PAGE(xa_index != idx + i, page) | 
| 135 | set_page_private(page + i, val + i) | 
| 141 | ADD_CACHE_INFO(add_total, nr) | 
| 142 | unlock : | 
| 143 | xas_unlock_irq( & xas) | 
| 146 | If Not xas_error() - Return an errno stored in the xa_state.*@xas: XArray operation state.* Return: 0 if no error has been noted. A negative errno if one has. Then Return 0 | 
| 149 | ClearPageSwapCache(page) | 
| 150 | page_ref_sub(page, nr) | 
| Name | Describe | 
|---|---|
| add_to_swap | add_to_swap - allocate swap space for a page*@page: page we want to move to swap* Allocate swap space for the page and add the page to the* swap cache. Caller needs to hold the page lock. | 
| __read_swap_cache_async | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |