函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\iomap\swapfile.c Create Date:2022-07-29 11:08:10
Last Modify:2020-03-18 11:03:10 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Iterate a swap file's iomaps to construct physical extents that can be* passed to the swapfile subsystem.

函数原型:int iomap_swapfile_activate(struct swap_info_struct *sis, struct file *swap_file, sector_t *pagespan, const struct iomap_ops *ops)

返回类型:int

参数:

类型参数名称
struct swap_info_struct *sis
struct file *swap_file
sector_t *pagespan
const struct iomap_ops *ops
139  struct iomap_swapfile_info isi = {sis = sis, lowest physical addr seen (pages) = (sector_t) - 1ULL, }
143  mapping等于f_mapping
144  inode等于host
145  pos等于0
146  len等于ALIGN_DOWN(NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they , PAGE_SIZE)
153  ret等于vfs_fsync - perform a fsync or fdatasync on a file*@file: file to sync*@datasync: only perform a fdatasync operation* Write back data and metadata for @file to disk. If @datasync is* set only metadata needed to access modified file data is written.
154  如果ret则返回:ret
157 len大于0循环
158  ret等于Execute a iomap write on a segment of the mapping that spans a* contiguous range of pages that have identical block mapping state
160  如果ret小于等于0则返回:ret
163  pos加等于ret
164  len减等于ret
167  如果 length of mapping, bytes
168  ret等于Collect physical extents for this swap file. Physical extents reported to* the swap code must be trimmed to align to a page boundary. The logical* offset within the file is irrelevant since the swapfile code maps logical
169  如果ret则返回:ret
173  pagespan等于1加highest physical addr seen (pages) lowest physical addr seen (pages)
174  xtent of the swap_map 等于umber of pages collected
175  al of usable pages of swap 等于umber of pages collected 减1
176  dex of last free in swap_map 等于umber of pages collected 减1
177  返回:xtent count