Commit a72ea3ac authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

Put MountOptions in the public types.go header.

parent 95ecd2db
...@@ -141,14 +141,7 @@ func (me *inode) setParent(newParent *inode) { ...@@ -141,14 +141,7 @@ func (me *inode) setParent(newParent *inode) {
} }
} }
type MountOptions struct { func NewMountOptions() *MountOptions {
EntryTimeout float64
AttrTimeout float64
NegativeTimeout float64
}
func MakeMountOptions() *MountOptions {
return &MountOptions{ return &MountOptions{
NegativeTimeout: 0.0, NegativeTimeout: 0.0,
AttrTimeout: 1.0, AttrTimeout: 1.0,
...@@ -429,7 +422,7 @@ func (me *FileSystemConnector) Mount(mountPoint string, fs FileSystem, opts *Mou ...@@ -429,7 +422,7 @@ func (me *FileSystemConnector) Mount(mountPoint string, fs FileSystem, opts *Mou
node.mount = newMount(fs) node.mount = newMount(fs)
if opts == nil { if opts == nil {
opts = MakeMountOptions() opts = NewMountOptions()
} }
node.mount.options = opts node.mount.options = opts
return OK return OK
......
...@@ -598,7 +598,16 @@ type FileSystem interface { ...@@ -598,7 +598,16 @@ type FileSystem interface {
// unimplemented: poll, ioctl, bmap. // unimplemented: poll, ioctl, bmap.
} }
// Include this struct in your implementation to inherit default nop // MountOptions contains time out options for a FileSystem. The
// default copied from libfuse and set in NewMountOptions() is
// (1s,1s,0s).
type MountOptions struct {
EntryTimeout float64
AttrTimeout float64
NegativeTimeout float64
}
// Include these structs in your implementation to inherit default nop
// implementations. // implementations.
type DefaultFileSystem struct{} type DefaultFileSystem struct{}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment