函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\fadvise.c Create Date:2022-07-27 15:30:15
Last Modify:2020-03-17 21:10:40 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:POSIX_FADV_WILLNEED could set PG_Referenced, and POSIX_FADV_NOREUSE could* deactivate the pages and clear PG_Referenced.

函数原型:int generic_fadvise(struct file *file, loff_t offset, loff_t len, int advice)

返回类型:int

参数:

类型参数名称
struct file *file
loff_toffset
loff_tlen
intadvice
40  inode等于file_inode(file)
41  如果S_ISFIFO(i_mode)则返回:负ESPIPE
44  mapping等于f_mapping
45  如果非mappinglen小于0则返回:负EINVAL
48  bdi等于inode_to_bdi(host)
50  如果IS_DAX(inode)或bdi恒等于noop_backing_dev_info
52  :advice恒等于No further special treatment.
53  :advice恒等于Expect random page references.
54  :advice恒等于Expect sequential page references.
55  :advice恒等于Will need these pages.
56  :advice恒等于Data will be accessed once.
59  退出
60  默认
61  返回:负EINVAL
63  返回:0
71  endbyte等于offsetlen
72  如果非lenendbyte小于lenendbyte等于负1
74  否则endbyte自减
78  :advice恒等于No further special treatment.
79  Maximum readahead window 等于 max readahead in PAGE_SIZE units
80  加自旋锁
81  f_mode与等于Expect random access pattern 的反
82  自旋锁解锁
83  退出
84  :advice恒等于Expect random page references.
85  加自旋锁
86  f_mode或等于Expect random access pattern
87  自旋锁解锁
88  退出
89  :advice恒等于Expect sequential page references.
90  Maximum readahead window 等于 max readahead in PAGE_SIZE units 乘2
91  加自旋锁
92  f_mode与等于Expect random access pattern 的反
93  自旋锁解锁
94  退出
95  :advice恒等于Will need these pages.
97  start_index等于offset右移PAGE_SHIFT determines the page size
98  end_index等于endbyte右移PAGE_SHIFT determines the page size
101  nrpages等于end_indexstart_index加1
102  如果非nrpagesnrpages等于0UL的反
109  force_page_cache_readahead(mapping, file, start_index, nrpages)
110  退出
111  :advice恒等于Data will be accessed once.
112  退出
113  :advice恒等于Don't need these pages.
114  如果非inode_write_congested(host)则__filemap_fdatawrite_range - start writeback on mapping dirty pages in range*@mapping: address space structure to write*@start: offset in bytes where the range starts*@end: offset in bytes where the range ends (inclusive)*@sync_mode: enable synchronous
123  start_index等于offsetPAGE_SIZE减1右移PAGE_SHIFT determines the page size
124  end_index等于endbyte右移PAGE_SHIFT determines the page size
132  如果endbyte按位与PAGE_MASK的反的值不等于PAGE_MASK的反且endbyte不等于i_size减1则
139  如果end_index恒等于0则退出
142  end_index自减
145  如果end_index大于等于start_index
157  lru_add_drain()
168  如果count小于end_indexstart_index加1则
174  退出
175  默认
176  返回:负EINVAL
178  返回:0
调用者
名称描述
vfs_fadvise