函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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.

函数原型:static loff_t page_cache_seek_hole_data(struct inode *inode, loff_t offset, loff_t length, int whence)

返回类型:loff_t

参数:

类型参数名称
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  如果length小于等于0则返回:负ENOENT
85  pagevec_init( & pvec)
87  循环
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  如果nr_pages恒等于0则退出
95 i小于nr_pages循环
96  page等于pages[i]
102  pagevec_release( & pvec)
103 index小于end循环
106  如果whence不等于seek to the next hole 则转到:not_found
109  check_range :
110  如果lastoff小于offsetlength则转到:out
112  not_found :
113  lastoff等于负ENOENT
114  out :
115  pagevec_release( & pvec)
116  返回:lastoff
调用者
名称描述
iomap_seek_hole_actor
iomap_seek_data_actor