函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Accumulate iomaps for this swap file. We have to accumulate iomaps because* swap only cares about contiguous page-aligned physical extents and makes no* distinction between written and unwritten extents.

函数原型:static loff_t iomap_swapfile_activate_actor(struct inode *inode, loff_t pos, loff_t count, void *data, struct iomap *iomap, struct iomap *srcmap)

返回类型:loff_t

参数:

类型参数名称
struct inode *inode
loff_tpos
loff_tcount
void *data
struct iomap *iomap
struct iomap *srcmap
82  isi等于data
86  : type of mapping 恒等于locks allocated at @addr
87  : type of mapping 恒等于locks allocated at @addr in unwritten state
89  退出
90  : type of mapping 恒等于data inline in the inode
92  打印错误信息("swapon: file is inline\n")
93  返回:负EINVAL
94  默认
95  打印错误信息("swapon: file has unallocated extents\n")
96  返回:负EINVAL
100  如果 flags for mapping 按位与IOMAP_F_DIRTY
101  打印错误信息("swapon: file is not committed\n")
102  返回:负EINVAL
104  如果 flags for mapping 按位与IOMAP_F_SHARED
105  打印错误信息("swapon: file has shared extents\n")
106  返回:负EINVAL
110  如果 block device for I/O 不等于swap device or bdev of swap file
111  打印错误信息("swapon: file is on multiple devices\n")
112  返回:负EINVAL
115  如果 length of mapping, bytes 恒等于0则
117  memcpy( & accumulated iomap , iomap, accumulated iomap 的长度)
118  否则如果 disk offset of mapping, bytes length of mapping, bytes 恒等于 disk offset of mapping, bytes
120  length of mapping, bytes 加等于 length of mapping, bytes
121  否则
123  error等于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
124  如果error则返回:error
126  memcpy( & accumulated iomap , iomap, accumulated iomap 的长度)
128  返回:count