函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:swsusp_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

函数原型:int swsusp_write(unsigned int flags)

返回类型:int

参数:

类型参数名称
unsigned intflags
909  pages等于snapshot_get_image_size()
910  error等于get_swap_writer( & handle)
911  如果error
912  打印错误信息("Cannot get swap writer\n")
913  返回:error
915  如果flags按位与SF_NOCOMPRESS_MODE
917  打印错误信息("Not enough free swap\n")
918  error等于负ENOSPC
919  转到:out_finish
922  memset( & snapshot, 0, sizeof(structsnapshot_handle))
923  error等于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
924  如果error小于PAGE_SIZE
925  如果error大于等于0则error等于负EFAULT
928  转到:out_finish
930  header等于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)
931  error等于swap_write_page( & handle, header, NULL)
932  如果非error
933  error等于如果flags按位与SF_NOCOMPRESS_MODEsave_image - save the suspend image data否则save_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.
937  out_finish :
938  error等于swap_writer_finish( & handle, flags, error)
939  返回:error
调用者
名称描述
hibernatehibernate - Carry out system hibernation, including saving the image.