函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\power\swap.c Create Date:2022-07-27 11:02:32
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:save_image - save the suspend image data

函数原型:static int save_image(struct swap_map_handle *handle, struct snapshot_handle *snapshot, unsigned int nr_to_write)

返回类型:int

参数:

类型参数名称
struct swap_map_handle *handle
struct snapshot_handle *snapshot
unsigned intnr_to_write
542  hib_init_batch( & hb)
544  打印信息("Saving image data pages (%u pages)...\n", nr_to_write)
546  m等于nr_to_write除10
547  如果非mm等于1
549  nr_pages等于0
550  start等于ktime_get()
551  当1循环
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  如果ret小于等于0则退出
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  如果ret退出
558  如果非nr_pagesm的模则打印信息("Image saving progress: %3d%%\n", nr_pages / m * 10)
561  nr_pages自加
563  err2等于hib_wait_io( & hb)
564  stop等于ktime_get()
565  如果非retret等于err2
567  如果非ret打印信息("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  返回:ret
调用者
名称描述
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