mirror of
https://github.com/rclone/rclone.git
synced 2024-11-26 10:25:03 +01:00
mount: put read and write async buffers back - control with --buffer-size #1043
This commit is contained in:
parent
7fa687b3e1
commit
9a9d09845c
@ -29,7 +29,7 @@ func newReadFileHandle(o fs.Object) (*ReadFileHandle, error) {
|
|||||||
}
|
}
|
||||||
fh := &ReadFileHandle{
|
fh := &ReadFileHandle{
|
||||||
o: o,
|
o: o,
|
||||||
r: fs.NewAccount(r, o), // account the transfer
|
r: fs.NewAccountWithBuffer(r, o), // account the transfer
|
||||||
}
|
}
|
||||||
fs.Stats.Transferring(fh.o.Remote())
|
fs.Stats.Transferring(fh.o.Remote())
|
||||||
return fh, nil
|
return fh, nil
|
||||||
@ -68,7 +68,6 @@ func (fh *ReadFileHandle) seek(offset int64, reopen bool) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
fs.Debugf(fh.o, "ReadFileHandle.Read seek close old failed: %v", err)
|
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.r.UpdateReader(r)
|
||||||
}
|
}
|
||||||
fh.offset = offset
|
fh.offset = offset
|
||||||
|
@ -38,7 +38,7 @@ func newWriteFileHandle(d *Dir, f *File, src fs.ObjectInfo) (*WriteFileHandle, e
|
|||||||
file: f,
|
file: f,
|
||||||
}
|
}
|
||||||
fh.pipeReader, fh.pipeWriter = io.Pipe()
|
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() {
|
go func() {
|
||||||
o, err := d.f.Put(r, src)
|
o, err := d.f.Put(r, src)
|
||||||
fh.o = o
|
fh.o = o
|
||||||
|
Loading…
Reference in New Issue
Block a user