Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name: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

Proto:int swsusp_write(unsigned int flags)

Type:int

Parameter:

TypeParameterName
unsigned intflags
909  pages = snapshot_get_image_size()
910  error = get_swap_writer( & handle)
911  If error Then
912  pr_err("Cannot get swap writer\n")
913  Return error
915  If flags & SF_NOCOMPRESS_MODE Then
917  pr_err("Not enough free swap\n")
918  error = -ENOSPC
919  Go to 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  If error < PAGE_SIZE Then
925  If error >= 0 Then error = -EFAULT
928  Go to 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  If Not error Then
933  error = If flags & SF_NOCOMPRESS_MODE Then save_image - save the suspend image data Else 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  Return error