Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:snapshot_read_next - Get the address to read the next image page from.*@handle: Snapshot handle to be used for the reading.* On the first call, @handle should point to a zeroed snapshot_handle* structure

Proto:int snapshot_read_next(struct snapshot_handle *handle)

Type:int

Parameter:

TypeParameterName
struct snapshot_handle *handle
2097  If umber of the block of PAGE_SIZE bytes the* next operation will refer to (ie. current) > Number of pages needed for saving the original pfns of the image pages + Total number of image pages Then Return 0
2100  If Not Pointer to an auxiliary buffer (1 page) Then
2102  Pointer to an auxiliary buffer (1 page) = get_image_page - Allocate a page for a hibernation image
2103  If Not Pointer to an auxiliary buffer (1 page) Then Return -ENOMEM
2106  If Not umber of the block of PAGE_SIZE bytes the* next operation will refer to (ie. current) Then
2109  error = init_header((structswsusp_info * )Pointer to an auxiliary buffer (1 page) )
2110  If error Then Return error
2112  address of the block to read from* or write to = Pointer to an auxiliary buffer (1 page)
2113  memory_bm_position_reset( & Memory bitmap used for marking saveable pages (during hibernation) or* hibernation image pages (during restore))
2114  memory_bm_position_reset( & Memory bitmap used during hibernation for marking allocated page frames that* will contain copies of saveable pages. During restore it is initially used* for marking hibernation image pages, but then the set bits from it are)
2115  Else if umber of the block of PAGE_SIZE bytes the* next operation will refer to (ie. current) <= Number of pages needed for saving the original pfns of the image pages Then
2116  clear_page(Pointer to an auxiliary buffer (1 page) )
2117  pack_pfns - Prepare PFNs for saving.*@bm: Memory bitmap.*@buf: Memory buffer to store the PFNs in.* PFNs corresponding to set bits in @bm are stored in the area of memory* pointed to by @buf (1 page at a time).
2118  Else
2121  page = pfn_to_page(memory_bm_rtree_next_pfn - Find the next set bit in a memory bitmap.*@bm: Memory bitmap.* Starting from the last returned position this function searches for the next* set bit in @bm and returns the PFN represented by it. If no more bits are)
2122  If PageHighMem(page) Then
2130  kaddr = kmap_atomic(page)
2134  Else
2138  umber of the block of PAGE_SIZE bytes the* next operation will refer to (ie. current)++
2139  Return PAGE_SIZE
Caller
NameDescribe
save_imagesave_image - save the suspend image data
save_image_lzosave_image_lzo - Save the suspend image data compressed with LZO.*@handle: Swap map handle to use for saving the image.*@snapshot: Image to read data from.*@nr_to_write: Number of pages to save.
swsusp_writeswsusp_write - Write entire image and metadata.*@flags: flags to pass to the "boot" kernel in the image header* It is important _NOT_ to umount filesystems at this point. We want* them synced (in case something goes wrong) but we DO not want to mark
snapshot_read