Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:sync_file_range

Proto:int sync_file_range(struct file *file, loff_t offset, loff_t nbytes, unsigned int flags)

Type:int

Parameter:

TypeParameterName
struct file *file
loff_toffset
loff_tnbytes
unsigned intflags
245  ret = -EINVAL
246  If flags & ~VALID_FLAGS Then Go to out
249  endbyte = offset + nbytes
251  If offset < 0 Then Go to out
253  If endbyte < 0 Then Go to out
255  If endbyte < offset Then Go to out
258  If size of The type of an index into the pagecache == 4 Then
259  If offset >= 0x100000000ULL << PAGE_SHIFT determines the page size Then
264  ret = 0
265  Go to out
267  If endbyte >= 0x100000000ULL << PAGE_SHIFT determines the page size Then
271  nbytes = 0
275  If nbytes == 0 Then endbyte = LLONG_MAX
277  Else endbyte--
280  i_mode = i_mode
281  ret = -ESPIPE
282  If Not S_ISREG(i_mode) && Not S_ISBLK(i_mode) && Not S_ISDIR(i_mode) && Not S_ISLNK(i_mode) Then Go to out
286  mapping = f_mapping
287  ret = 0
288  If flags & SYNC_FILE_RANGE_WAIT_BEFORE Then
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  If ret < 0 Then Go to out
294  If flags & SYNC_FILE_RANGE_WRITE Then
295  sync_mode = Don't wait on anything
297  If (flags & SYNC_FILE_RANGE_WRITE_AND_WAIT) == SYNC_FILE_RANGE_WRITE_AND_WAIT Then sync_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  If ret < 0 Then Go to out
307  If flags & SYNC_FILE_RANGE_WAIT_AFTER Then 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
310  out :
311  Return ret
Caller
NameDescribe
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