Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

mount: put read and write async buffers back - control with --buffer-size #1043

Nick Craig-Wood9a9d09845cdc
diff --git a/cmd/mount/read.go b/cmd/mount/read.go
index fdaf569e0..3cd88522b 100644
--- a/cmd/mount/read.go
+++ b/cmd/mount/read.go
@@ -29,7 +29,7 @@ func newReadFileHandle(o fs.Object) (*ReadFileHandle, error) {
}
fh := &ReadFileHandle{
o: o,
- r: fs.NewAccount(r, o), // account the transfer
+ r: fs.NewAccountWithBuffer(r, o), // account the transfer
}
fs.Stats.Transferring(fh.o.Remote())
return fh, nil
@@ -68,7 +68,6 @@ func (fh *ReadFileHandle) seek(offset int64, reopen bool) error {
if err != nil {
fs.Debugf(fh.o, "ReadFileHandle.Read seek close old failed: %v", err)
}
- // fh.r = fs.NewAccount(r, fh.o) // account the transfer
fh.r.UpdateReader(r)
}
fh.offset = offset
diff --git a/cmd/mount/write.go b/cmd/mount/write.go
index 89fd6ddee..589b6231c 100644
--- a/cmd/mount/write.go
+++ b/cmd/mount/write.go
@@ -38,7 +38,7 @@ func newWriteFileHandle(d *Dir, f *File, src fs.ObjectInfo) (*WriteFileHandle, e
file: f,
}
fh.pipeReader, fh.pipeWriter = io.Pipe()
- r := fs.NewAccountSizeName(fh.pipeReader, 0, src.Remote()) // account the transfer
+ r := fs.NewAccountSizeNameWithBuffer(fh.pipeReader, 0, src.Remote()) // account the transfer
go func() {
o, err := d.f.Put(r, src)
fh.o = o