Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:swap_read_page

Proto:static int swap_read_page(struct swap_map_handle *handle, void *buf, struct hib_bio_batch *hb)

Type:int

Parameter:

TypeParameterName
struct swap_map_handle *handle
void *buf
struct hib_bio_batch *hb
1014  If Not cur Then Return -EINVAL
1016  offset = entries[k]
1017  If Not offset Then Return -EFAULT
1019  error = hib_submit_io(REQ_OP_READ, 0, offset, buf, hb)
1020  If error Then Return error
1022  If ++k >= The swap map is a data structure used for keeping track of each page* written to a swap partition Then
1023  k = 0
1024  free_page((unsignedlong)map)
1025  tmp = maps
1026  maps = next
1027  kfree - free previously allocated memory*@objp: pointer returned by kmalloc.* If @objp is NULL, no operation is performed.* Don't free memory not originally allocated by kmalloc()* or you will run into trouble.
1028  If Not maps Then The following functions allow us to read data using a swap map* in a file-alike way
1030  Else cur = map
1033  Return error
Caller
NameDescribe
load_imageload_image - load the image using the swap map handle*@handle and the snapshot handle @snapshot* (assume there are @nr_pages pages to load)
load_image_lzoload_image_lzo - Load compressed image data and decompress them with LZO.*@handle: Swap map handle to use for loading data.*@snapshot: Image to copy uncompressed data into.*@nr_to_read: Number of pages to load.
swsusp_readswsusp_read - read the hibernation image.*@flags_p: flags passed by the "frozen" kernel in the image header should* be written into this memory location