diff --git a/mounted_file_system.go b/mounted_file_system.go index b1e52de..d456561 100644 --- a/mounted_file_system.go +++ b/mounted_file_system.go @@ -117,10 +117,25 @@ func (mfs *MountedFileSystem) mountAndServe( // Optional configuration accepted by Mount. type MountConfig struct { + // OS X only. + // + // Normally on OS X we mount with the novncache option + // (cf. http://goo.gl/1pTjuk), which disables entry caching in the kernel. + // This is because osxfuse does not support the entry expiration values we + // return to it (cf. http://goo.gl/8yR0Ie) and it is probably better to fail + // to cache than to cache for too long, since the latter is more likely to + // hide consistency bugs that are difficult to detect and diagnose. + // + // This field disables the use of novncache, restoring entry caching. Beware: + // the value of ChildInodeEntry.EntryExpiration is ignored by the kernel, and + // entries will be cached for an arbitrarily long time. + EnableVnodeCaching bool } // Convert to mount options to be passed to package bazilfuse. func (c *MountConfig) bazilfuseOptions() (opts []bazilfuse.MountOption) { + panic("TODO: Test and support MountConfig.EnableVnodeCaching") + opts = []bazilfuse.MountOption{ // Enable permissions checking in the kernel. See the comments on // InodeAttributes.Mode.