Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swapfile.c Create Date:2022-07-28 15:20:28
Last Modify:2020-03-17 22:19:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:swap_count_continued - when the original swap_map count is incremented* from SWAP_MAP_MAX, check if there is already a continuation page to carry* into, carry if so, or else fail until a new continuation page is allocated;* when the original swap_map

Proto:static bool swap_count_continued(struct swap_info_struct *si, unsigned long offset, unsigned char count)

Type:bool

Parameter:

TypeParameterName
struct swap_info_struct *si
unsigned longoffset
unsigned charcount
3649  head = Walk a vmap address to the struct page it maps.
3650  If page_private(head) != SWP_CONTINUED Then
3651  BUG_ON(count & See swap_map continuation for full count )
3652  Return false
3655  spin_lock( & protect swap count continuation page* list.)
3656  offset &= ~PAGE_MASK
3657  page = list_entry - get the struct for this entry*@ptr: the &struct list_head pointer.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.(next, structpage, lru)
3658  map = kmap_atomic(page) + offset
3660  If count == Max duplication count, in first swap_map Then Go to init_map
3663  If count == (Max duplication count, in first swap_map | See swap_map continuation for full count ) Then
3670  BUG_ON(page == head)
3671  map = kmap_atomic(page) + offset
3676  If page == head Then
3677  ret = false
3678  Go to out
3680  map = kmap_atomic(page) + offset
3681  init_map :
3681  map = 0
3683  map += 1
3684  Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(map)
3685  page = list_entry - get the struct for this entry*@ptr: the &struct list_head pointer.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.(prev, structpage, lru)
3686  When page != head cycle
3687  map = kmap_atomic(page) + offset
3692  ret = true
3694  Else
3698  BUG_ON(count != See swap_map continuation for full count )
3702  BUG_ON(page == head)
3703  map = kmap_atomic(page) + offset
3705  BUG_ON( * map == 0)
3706  map -= 1
3707  If map == 0 Then count = 0
3709  Prevent people trying to call kunmap_atomic() as if it were kunmap()* kunmap_atomic() should get the return value of kmap_atomic, not the page.(map)
3710  page = list_entry - get the struct for this entry*@ptr: the &struct list_head pointer.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.(prev, structpage, lru)
3711  When page != head cycle
3712  map = kmap_atomic(page) + offset
3718  ret = count == See swap_map continuation for full count
3720  out :
3721  spin_unlock( & protect swap count continuation page* list.)
3722  Return ret
Caller
NameDescribe
__swap_entry_free_locked
__swap_duplicateVerify 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