函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:swap_write_page

函数原型:static int swap_write_page(struct swap_map_handle *handle, void *buf, struct hib_bio_batch *hb)

返回类型:int

参数:

类型参数名称
struct swap_map_handle *handle
void *buf
struct hib_bio_batch *hb
443  error等于0
446  如果非cur则返回:负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  如果error则返回:error
452  entries[k++]等于offset
453  如果k大于等于The swap map is a data structure used for keeping track of each page* written to a swap partition
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  如果非offset则返回:负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  如果error则转到:out
461  clear_page(cur)
462  cur_swap等于offset
463  k等于0
466  error等于hib_wait_io(hb)
467  如果error则转到:out
476  out :
477  返回:error
调用者
名称描述
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