Closed arvidn closed 1 month ago
Just for the context, from posix_fadvise(2)
:
Under Linux,
POSIX_FADV_NORMAL
sets the readahead window to the default size for the backing device;POSIX_FADV_SEQUENTIAL
doubles this size, andPOSIX_FADV_RANDOM
disables file readahead entirely.
@HanabishiRecca thanks for your testing and review!
Normal piece sizes, of 2 or 4 MiB, probably warrants read-ahead. Some antecdotes suggests this improve read speed in some circumstances.
The use of the internal open mode flag
random_access
is really used to hint sequential access, for when checking files. This patch, therefore, renames the flag tosequential_access
and makes it mean that instead.This is an internal flag so doesn't affect the user facing API.