vfs: add --vfs-read-ahead parameter for use with --vfs-cache-mode full

This parameter causes extra read-ahead over --buffer-size which is not
buffered in memory but on disk.
This commit is contained in:
Nick Craig-Wood
2020-08-05 09:57:03 +01:00
parent 177d2f2f79
commit 109b695621
4 changed files with 22 additions and 7 deletions

View File

@@ -31,6 +31,7 @@ type Options struct {
WriteWait time.Duration // time to wait for in-sequence write
ReadWait time.Duration // time to wait for in-sequence read
WriteBack time.Duration // time to wait before writing back dirty files
ReadAhead fs.SizeSuffix // bytes to read ahead in cache mode "full"
}
// DefaultOpt is the default values uses for Opt
@@ -56,4 +57,5 @@ var DefaultOpt = Options{
WriteWait: 1000 * time.Millisecond,
ReadWait: 20 * time.Millisecond,
WriteBack: 5 * time.Second,
ReadAhead: 0 * fs.MebiByte,
}