gvisor/pkg
Andrei Vagin 2ef122da35 Implement sync_file_range()
sync_file_range - sync a file segment with disk

In Linux, sync_file_range() accepts three flags:

       SYNC_FILE_RANGE_WAIT_BEFORE
              Wait  upon  write-out  of  all pages in the specified range that
              have already been submitted to the device driver  for  write-out
              before performing any write.

       SYNC_FILE_RANGE_WRITE
              Initiate  write-out  of  all  dirty pages in the specified range
              which are not presently submitted  write-out.   Note  that  even
              this  may  block if you attempt to write more than request queue
              size.

       SYNC_FILE_RANGE_WAIT_AFTER
              Wait upon write-out of all pages in the range  after  performing
              any write.

In this implementation:

SYNC_FILE_RANGE_WAIT_BEFORE without SYNC_FILE_RANGE_WAIT_AFTER isn't
supported right now.

SYNC_FILE_RANGE_WRITE is skipped. It should initiate write-out of  all
dirty pages, but it doesn't wait, so it should be safe to do nothing
while nobody uses SYNC_FILE_RANGE_WAIT_BEFORE.

SYNC_FILE_RANGE_WAIT_AFTER is equal to fdatasync(). In Linux,
sync_file_range() doesn't writes out the  file's  meta-data, but
fdatasync() does if a file size is changed.

PiperOrigin-RevId: 220730840
Change-Id: Iae5dfb23c2c916967d67cf1a1ad32f25eb3f6286
2018-11-08 17:39:51 -08:00
..
abi Implement sync_file_range() 2018-11-08 17:39:51 -08:00
amutex Mark amutex_test as flaky. 2018-10-31 19:33:09 -07:00
atomicbitops Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
binary Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
bits Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
bpf Use correct company name in copyright header 2018-10-19 16:35:11 -07:00
compressio Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
control Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
cpuid Clean up cpuid_parse_test 2018-10-30 15:56:12 -07:00
dhcp Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
eventchannel Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
fd Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
gate Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
ilist Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
linewriter Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
log Add new log format that is compatible with Kubernetes 2018-11-01 17:44:58 -07:00
metric Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
p9 Use correct company name in copyright header 2018-11-05 17:23:56 -08:00
rand Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
refs Use correct company name in copyright header 2018-10-19 16:35:11 -07:00
seccomp Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
secio Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
segment Use correct company name in copyright header 2018-10-19 16:35:11 -07:00
sentry Implement sync_file_range() 2018-11-08 17:39:51 -08:00
sleep Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
state Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
sync Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
syserr Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
syserror Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
tcpip Fix flaky TestCacheResolutionTimeout 2018-11-07 12:01:48 -08:00
tmutex Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
unet Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
urpc Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00
waiter Track paths and provide a rename hook. 2018-10-23 00:20:15 -07:00