Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\iomap\swapfile.c Create Date:2022-07-28 20:32:27
Last Modify:2020-03-18 11:03:10 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

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

Proto:static int iomap_swapfile_add_extent(struct iomap_swapfile_info *isi)

Type:int

Parameter:

TypeParameterName
struct iomap_swapfile_info *isi
31  iomap = accumulated iomap
42  first_ppage = @a is a power of 2 value ( disk offset of mapping, bytes , PAGE_SIZE) >> PAGE_SHIFT determines the page size
43  next_ppage = ALIGN_DOWN( disk offset of mapping, bytes + length of mapping, bytes , PAGE_SIZE) >> PAGE_SHIFT determines the page size
47  If first_ppage >= next_ppage Then Return 0
49  nr_pages = next_ppage - first_ppage
56  first_ppage_reported = first_ppage
57  If file offset of mapping, bytes == 0 Then first_ppage_reported++
59  If lowest physical addr seen (pages) > first_ppage_reported Then lowest physical addr seen (pages) = first_ppage_reported
61  If highest physical addr seen (pages) < next_ppage - 1 Then highest physical addr seen (pages) = next_ppage - 1
65  error = Add a block range (and the corresponding page range) into this swapdev's* extent tree.* This function rather assumes that it is called in ascending page order.
66  If error < 0 Then Return error
68  xtent count += error
69  umber of pages collected += nr_pages
70  Return 0
Caller
NameDescribe
iomap_swapfile_activate_actorAccumulate 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.
iomap_swapfile_activateIterate a swap file's iomaps to construct physical extents that can be* passed to the swapfile subsystem.