Function report | 
Source Code:mm\swapfile.c | 
Create Date:2022-07-28 15:20:09 | 
| Last Modify:2020-03-17 22:19:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:Verify that a swap entry is valid and increment its swap map count.* Returns error code in following case.* - success -> 0* - swp_entry is invalid -> EINVAL* - swp_entry is migration entry -> EINVAL
Proto:static int __swap_duplicate(swp_entry_t entry, unsigned char usage)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| swp_entry_t | entry | |
| unsigned char | usage | 
| 3398 | offset = Extract the `offset' field from a swp_entry_t. The swp_entry_t is in* arch-independent format | 
| 3399 | ci = Determine the locking method in use for this device. Return* swap_cluster_info if SSD-style cluster-based locking is in place. | 
| 3401 | count = vmalloc'ed array of usage counts [offset] | 
| 3409 | Go to unlock_out | 
| 3414 | err = 0 | 
| 3416 | If usage == Flag page is cached, in first swap_map Then | 
| 3419 | If Not has_cache && count Then has_cache = Flag page is cached, in first swap_map | 
| 3428 | If (count & ~See swap_map continuation for full count ) < Max duplication count, in first swap_map Then count += usage | 
| 3430 | Else if (count & ~See swap_map continuation for full count ) > Max duplication count, in first swap_map Then err = -EINVAL | 
| 3439 | vmalloc'ed array of usage counts [offset] = count | has_cache | 
| 3441 | unlock_out : | 
| 3442 | unlock_cluster_or_swap_info(p, ci) | 
| 3443 | out : | 
| 3444 | If p Then put_swap_device(p) | 
| 3446 | Return err | 
| Name | Describe | 
|---|---|
| swap_shmem_alloc | Help swapoff by noting that swap entry belongs to shmem/tmpfs* (in which case its reference count is never incremented). | 
| swap_duplicate | Increase reference count of swap entry by 1 | 
| swapcache_prepare | @entry: swap entry for which we allocate swap cache.* Called when allocating swap cache for existing swap entry,* This can return error codes. Returns 0 at success.* -EBUSY means there is a swap cache.* Note: return code is different from swap_duplicate(). | 
| 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  |