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

mountlib: pass options in fsys not as args

Nick Craig-Woodd127d8686ac1
diff --git a/cmd/mountlib/file.go b/cmd/mountlib/file.go
index 75785137d..07cc67d22 100644
--- a/cmd/mountlib/file.go
+++ b/cmd/mountlib/file.go
@@ -165,7 +165,7 @@ func (f *File) OpenRead() (fh *ReadFileHandle, err error) {
}
fs.Debugf(o, "File.OpenRead")
- fh, err = newReadFileHandle(f, o, f.d.fsys.noSeek)
+ fh, err = newReadFileHandle(f, o)
err = errors.Wrap(err, "open for read")
if err != nil {
diff --git a/cmd/mountlib/read.go b/cmd/mountlib/read.go
index 0fb93543d..f97216d36 100644
--- a/cmd/mountlib/read.go
+++ b/cmd/mountlib/read.go
@@ -21,7 +21,7 @@ type ReadFileHandle struct {
hash *fs.MultiHasher
}
-func newReadFileHandle(f *File, o fs.Object, noSeek bool) (*ReadFileHandle, error) {
+func newReadFileHandle(f *File, o fs.Object) (*ReadFileHandle, error) {
r, err := o.Open()
if err != nil {
return nil, err
@@ -38,7 +38,7 @@ func newReadFileHandle(f *File, o fs.Object, noSeek bool) (*ReadFileHandle, erro
fh := &ReadFileHandle{
o: o,
r: fs.NewAccount(r, o).WithBuffer(), // account the transfer
- noSeek: noSeek,
+ noSeek: f.d.fsys.noSeek,
file: f,
hash: hash,
}