cmd/mountlib: convert time.Duration option to fs.Duration
This commit is contained in:
+4
-3
@@ -7,6 +7,7 @@ package mount2
|
||||
import (
|
||||
"os"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/hanwen/go-fuse/v2/fuse"
|
||||
"github.com/rclone/rclone/cmd/mountlib"
|
||||
@@ -88,14 +89,14 @@ func setAttr(node vfs.Node, attr *fuse.Attr) {
|
||||
// fill in AttrOut from node
|
||||
func (f *FS) setAttrOut(node vfs.Node, out *fuse.AttrOut) {
|
||||
setAttr(node, &out.Attr)
|
||||
out.SetTimeout(f.opt.AttrTimeout)
|
||||
out.SetTimeout(time.Duration(f.opt.AttrTimeout))
|
||||
}
|
||||
|
||||
// fill in EntryOut from node
|
||||
func (f *FS) setEntryOut(node vfs.Node, out *fuse.EntryOut) {
|
||||
setAttr(node, &out.Attr)
|
||||
out.SetEntryTimeout(f.opt.AttrTimeout)
|
||||
out.SetAttrTimeout(f.opt.AttrTimeout)
|
||||
out.SetEntryTimeout(time.Duration(f.opt.AttrTimeout))
|
||||
out.SetAttrTimeout(time.Duration(f.opt.AttrTimeout))
|
||||
}
|
||||
|
||||
// Translate errors from mountlib into Syscall error numbers
|
||||
|
||||
+3
-2
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"runtime"
|
||||
"time"
|
||||
|
||||
fusefs "github.com/hanwen/go-fuse/v2/fs"
|
||||
"github.com/hanwen/go-fuse/v2/fuse"
|
||||
@@ -215,8 +216,8 @@ func mount(VFS *vfs.VFS, mountpoint string, opt *mountlib.Options) (<-chan error
|
||||
// FIXME fill out
|
||||
opts := fusefs.Options{
|
||||
MountOptions: *mountOpts,
|
||||
EntryTimeout: &opt.AttrTimeout,
|
||||
AttrTimeout: &opt.AttrTimeout,
|
||||
EntryTimeout: (*time.Duration)(&opt.AttrTimeout),
|
||||
AttrTimeout: (*time.Duration)(&opt.AttrTimeout),
|
||||
GID: VFS.Opt.GID,
|
||||
UID: VFS.Opt.UID,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user