函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:sync_file_range

函数原型:int sync_file_range(struct file *file, loff_t offset, loff_t nbytes, unsigned int flags)

返回类型:int

参数:

类型参数名称
struct file *file
loff_toffset
loff_tnbytes
unsigned intflags
245  ret等于负EINVAL
246  如果flags按位与VALID_FLAGS的反则转到:out
249  endbyte等于offsetnbytes
251  如果offset小于0则转到:out
253  如果endbyte小于0则转到:out
255  如果endbyte小于offset则转到:out
258  如果The type of an index into the pagecache.的长度恒等于4则
259  如果offset大于等于0x100000000ULL左移PAGE_SHIFT determines the page size 位则
264  ret等于0
265  转到:out
267  如果endbyte大于等于0x100000000ULL左移PAGE_SHIFT determines the page size 位则
271  nbytes等于0
275  如果nbytes恒等于0则endbyte等于LLONG_MAX
277  否则endbyte自减
280  i_mode等于i_mode
281  ret等于负ESPIPE
282  如果非S_ISREG(i_mode)且非S_ISBLK(i_mode)且非S_ISDIR(i_mode)且非S_ISLNK(i_mode)则转到:out
286  mapping等于f_mapping
287  ret等于0
288  如果flags按位与SYNC_FILE_RANGE_WAIT_BEFORE
289  ret等于le_fdatawait_range - wait for writeback to complete*@file: file pointing to address space structure to wait for*@start_byte: offset in bytes where the range starts*@end_byte: offset in bytes where the range ends (inclusive)* Walk the list of
290  如果ret小于0则转到:out
294  如果flags按位与SYNC_FILE_RANGE_WRITE
295  sync_mode等于Don't wait on anything
297  如果flags按位与SYNC_FILE_RANGE_WRITE_AND_WAIT的值恒等于SYNC_FILE_RANGE_WRITE_AND_WAITsync_mode等于Wait on every mapping
301  ret等于__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
303  如果ret小于0则转到:out
307  如果flags按位与SYNC_FILE_RANGE_WAIT_AFTERret等于le_fdatawait_range - wait for writeback to complete*@file: file pointing to address space structure to wait for*@start_byte: offset in bytes where the range starts*@end_byte: offset in bytes where the range ends (inclusive)* Walk the list of
310  out :
311  返回:ret
调用者
名称描述
ksys_sync_file_rangeksys_sync_file_range() permits finely controlled syncing over a segment of* a file in the range offset
io_sync_file_range_finish