Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\power\swap.c Create Date:2022-07-28 10:02:12
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:swsusp_extents_insert

Proto:static int swsusp_extents_insert(unsigned long swap_offset)

Type:int

Parameter:

TypeParameterName
unsigned longswap_offset
132  new = &rb_node
133  struct rb_node * parent = NULL
137  When new cycle
138  ext = rb_entry( * new, structswsusp_extent, node)
139  parent = new
140  If swap_offset < start Then
142  If swap_offset == start - 1 Then
143  start--
144  Return 0
146  new = &rb_left
147  Else if swap_offset > end Then
149  If swap_offset == end + 1 Then
150  end++
151  Return 0
153  new = &rb_right
154  Else
156  Return -EINVAL
160  ext = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
161  If Not ext Then Return -ENOMEM
164  start = swap_offset
165  end = swap_offset
166  rb_link_node( & node, parent, new)
167  rb_insert_color( & node, & swsusp_extents)
168  Return 0
Caller
NameDescribe
alloc_swapdev_blockalloc_swapdev_block - allocate a swap page and register that it has* been allocated, so that it can be freed in case of an error.