Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:save_image - save the suspend image data

Proto:static int save_image(struct swap_map_handle *handle, struct snapshot_handle *snapshot, unsigned int nr_to_write)

Type:int

Parameter:

TypeParameterName
struct swap_map_handle *handle
struct snapshot_handle *snapshot
unsigned intnr_to_write
542  hib_init_batch( & hb)
544  pr_info("Saving image data pages (%u pages)...\n", nr_to_write)
546  m = nr_to_write / 10
547  If Not m Then m = 1
549  nr_pages = 0
550  start = ktime_get()
551  When 1 cycle
552  ret = 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
553  If ret <= 0 Then Break
555  ret = swap_write_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)
556  If ret Then Break
558  If Not (nr_pages % m) Then pr_info("Image saving progress: %3d%%\n", nr_pages / m * 10)
561  nr_pages++
563  err2 = hib_wait_io( & hb)
564  stop = ktime_get()
565  If Not ret Then ret = err2
567  If Not ret Then pr_info("Image saving done\n")
569  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.
570  Return ret
Caller
NameDescribe
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