Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:load_image - load the image using the swap map handle*@handle and the snapshot handle @snapshot* (assume there are @nr_pages pages to load)

Proto:static int load_image(struct swap_map_handle *handle, struct snapshot_handle *snapshot, unsigned int nr_to_read)

Type:int

Parameter:

TypeParameterName
struct swap_map_handle *handle
struct snapshot_handle *snapshot
unsigned intnr_to_read
1054  ret = 0
1061  hib_init_batch( & hb)
1063  When reading an {un,}compressed image, we may restore pages in place,* in which case some architectures need these pages cleaning before they* can be executed. We don't know which pages these may be, so clean the lot. = true
1064  pr_info("Loading image data pages (%u pages)...\n", nr_to_read)
1065  m = nr_to_read / 10
1066  If Not m Then m = 1
1068  nr_pages = 0
1069  start = ktime_get()
1070  cycle
1071  ret = snapshot_write_next - Get the address to store the next image page.*@handle: Snapshot handle structure to guide the writing.* On the first call, @handle should point to a zeroed snapshot_handle* structure
1072  If ret <= 0 Then Break
1074  ret = swap_read_page(handle, This macro returns the address from/to which the caller of* snapshot_read_next()/snapshot_write_next() is allowed to* read/write data after the function returns( * snapshot), & hb)
1075  If ret Then Break
1077  If Set to one to notify the caller of* snapshot_write_next() that it may* need to call wait_on_bio_chain() Then ret = hib_wait_io( & hb)
1079  If ret Then Break
1081  If Not (nr_pages % m) Then pr_info("Image loading progress: %3d%%\n", nr_pages / m * 10)
1084  nr_pages++
1086  err2 = hib_wait_io( & hb)
1087  stop = ktime_get()
1088  If Not ret Then ret = err2
1090  If Not ret Then
1091  pr_info("Image loading done\n")
1092  snapshot_write_finalize - Complete the loading of a hibernation image.* Must be called after the last call to snapshot_write_next() in case the last* page in the image happens to be a highmem page and its contents should be* stored in highmem
1093  If Not snapshot_image_loaded(snapshot) Then ret = -ENODATA
1096  swsusp_show_speed - Print time elapsed between two events during hibernation.*@start: Starting event.*@stop: Final event.*@nr_pages: Number of memory pages processed between @start and @stop.*@msg: Additional diagnostic message to print.
1097  Return ret
Caller
NameDescribe
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