函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swapfile.c Create Date:2022-07-27 16:50:54
Last Modify:2020-03-17 22:19:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

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

函数原型:static bool swap_count_continued(struct swap_info_struct *si, unsigned long offset, unsigned char count)

返回类型:bool

参数:

类型参数名称
struct swap_info_struct *si
unsigned longoffset
unsigned charcount
3649  head等于Walk a vmap address to the struct page it maps.
3650  如果page_private(head)不等于SWP_CONTINUED
3651  BUG_ON(count & See swap_map continuation for full count )
3652  返回:false
3655  加自旋锁
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.(链表后项, structpage, lru)
3658  map等于kmap_atomic(page)加offset
3660  如果count恒等于Max duplication count, in first swap_map 则转到:init_map
3663  如果count恒等于Max duplication count, in first swap_map 按位或See swap_map continuation for full count 的值则
3670  BUG_ON(page == head)
3671  map等于kmap_atomic(page)加offset
3676  如果page恒等于head
3677  ret = false
3678  转到: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.(链表前项, structpage, lru)
3686 page不等于head循环
3687  map等于kmap_atomic(page)加offset
3692  ret = true
3694  否则
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  如果map恒等于0则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.(链表前项, structpage, lru)
3711 page不等于head循环
3712  map等于kmap_atomic(page)加offset
3718  ret等于count恒等于See swap_map continuation for full count
3720  out :
3721  自旋锁解锁
3722  返回:ret
调用者
名称描述
__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