函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Seek for SEEK_DATA / SEEK_HOLE within @page, starting at @lastoff.* Returns true if found and updates @lastoff to the offset in file.

函数原型:static bool page_seek_hole_data(struct inode *inode, struct page *page, loff_t *lastoff, int whence)

返回类型:bool

参数:

类型参数名称
struct inode *inode
struct page *page
loff_t *lastoff
intwhence
21  ops等于a_ops
22  bsize等于i_blocksize(inode)
23  seek_data等于whence恒等于seek to the next data
24  poff等于Return byte-offset into filesystem object for page.
26  如果WARN_ON_ONCE( * lastoff >= poff + PAGE_SIZE)则返回:false
29  如果lastoff小于poff
34  如果whence恒等于seek to the next hole 则返回:true
36  lastoff等于poff
42  如果bsize恒等于PAGE_SIZE或非is_partially_uptodate则返回:PageUptodate(page)恒等于seek_data
45  lock_page may only be called if we have the page's inode pinned.
46  如果此条件成立可能性小(为编译器优化)( See page-flags.h for PAGE_MAPPING_FLAGS != i_mapping)则转到:out_unlock_not_found
49 off小于PAGE_SIZE循环
50  如果offset_in_page( * lastoff)大于等于offbsize则继续下一循环
52  如果is_partially_uptodate(page, off, bsize)恒等于seek_data
54  返回:true
56  lastoff等于poffoffbsize
59  out_unlock_not_found :
60  lock_page - unlock a locked page*@page: the page* Unlocks the page and wakes up sleepers in ___wait_on_page_locked().* Also wakes sleepers in wait_on_page_writeback() because the wakeup* mechanism between PageLocked pages and PageWriteback pages is shared.
61  返回:false
调用者
名称描述
page_cache_seek_hole_dataSeek 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.