Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Seek for SEEK_DATA / SEEK_HOLE in the page cache.* Within unwritten extents, the page cache determines which parts are holes* and which are data: uptodate buffer heads count as data; everything else* counts as a hole.

Proto:static loff_t page_cache_seek_hole_data(struct inode *inode, loff_t offset, loff_t length, int whence)

Type:loff_t

Parameter:

TypeParameterName
struct inode *inode
loff_toffset
loff_tlength
intwhence
77  index = offset >> PAGE_SHIFT determines the page size
78  end = DIV_ROUND_UP(offset + length, PAGE_SIZE)
79  lastoff = offset
82  If length <= 0 Then Return -ENOENT
85  pagevec_init( & pvec)
87  Do
90  nr_pages = pagevec_lookup_range - gang pagecache lookup*@pvec: Where the resulting pages are placed*@mapping: The address_space to search*@start: The starting page index*@end: The final page index* pagevec_lookup_range() will search for & return a group of up to
92  If nr_pages == 0 Then Break
95  When i < nr_pages cycle
96  page = pages[i]
102  pagevec_release( & pvec)
103  When index < end cycle
106  If whence != seek to the next hole Then Go to not_found
109  check_range :
110  If lastoff < offset + length Then Go to out
112  not_found :
113  lastoff = -ENOENT
114  out :
115  pagevec_release( & pvec)
116  Return lastoff
Caller
NameDescribe
iomap_seek_hole_actor
iomap_seek_data_actor