vfs: --vfs-used-is-size to report used space using recursive scan (#4043)

Some backends, most notably S3, do not report the amount of bytes used.
This patch introduces a new flag that allows instead of relying on the
backend, use recursive scan similar to `rclone size` to compute the total
used space. However, this is ineffective and should be used as a last resort.

Co-authored-by: Yves G <theYinYeti@yalis.fr>
This commit is contained in:
tYYGH
2021-02-17 21:36:13 +01:00
committed by GitHub
parent 297ca23abd
commit c0cf54067a
4 changed files with 35 additions and 2 deletions

View File

@@ -32,6 +32,7 @@ type Options struct {
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"
UsedIsSize bool // if true, use the `rclone size` algorithm for Used size
}
// DefaultOpt is the default values uses for Opt
@@ -58,4 +59,5 @@ var DefaultOpt = Options{
ReadWait: 20 * time.Millisecond,
WriteBack: 5 * time.Second,
ReadAhead: 0 * fs.MebiByte,
UsedIsSize: false,
}