Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:swap_write_page

Proto:static int swap_write_page(struct swap_map_handle *handle, void *buf, struct hib_bio_batch *hb)

Type:int

Parameter:

TypeParameterName
struct swap_map_handle *handle
void *buf
struct hib_bio_batch *hb
443  error = 0
446  If Not cur Then Return -EINVAL
448  offset = alloc_swapdev_block - allocate a swap page and register that it has* been allocated, so that it can be freed in case of an error.
449  error = write_page - Write one page to given swap location.*@buf: Address we're writing.*@offset: Offset of the swap page we're writing to.*@hb: bio completion batch
450  If error Then Return error
452  entries[k++] = offset
453  If k >= The swap map is a data structure used for keeping track of each page* written to a swap partition Then
454  offset = alloc_swapdev_block - allocate a swap page and register that it has* been allocated, so that it can be freed in case of an error.
455  If Not offset Then Return -ENOSPC
457  next_swap = offset
458  error = write_page - Write one page to given swap location.*@buf: Address we're writing.*@offset: Offset of the swap page we're writing to.*@hb: bio completion batch
459  If error Then Go to out
461  clear_page(cur)
462  cur_swap = offset
463  k = 0
466  error = hib_wait_io(hb)
467  If error Then Go to out
476  out :
477  Return error
Caller
NameDescribe
save_imagesave_image - save the suspend image data
save_image_lzosave_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.
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