From 7cddc48c2431d0d559f5b1f3ecc04bf51f02fd2f Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Tue, 17 Mar 2015 13:34:50 +1100 Subject: [PATCH] Fixed a build error. --- samples/cachingfs/caching_fs.go | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/samples/cachingfs/caching_fs.go b/samples/cachingfs/caching_fs.go index e304a49..6c3cd83 100644 --- a/samples/cachingfs/caching_fs.go +++ b/samples/cachingfs/caching_fs.go @@ -72,8 +72,10 @@ func NewCachingFS( lookupEntryTimeout time.Duration, getattrTimeout time.Duration) (fs CachingFS, err error) { cfs := &cachingFS{ - baseID: (fuse.RootInodeID + 1 + numInodes - 1) / numInodes, - mtime: time.Now(), + lookupEntryTimeout: lookupEntryTimeout, + getattrTimeout: getattrTimeout, + baseID: (fuse.RootInodeID + 1 + numInodes - 1) / numInodes, + mtime: time.Now(), } cfs.mu = syncutil.NewInvariantMutex(cfs.checkInvariants) @@ -93,6 +95,18 @@ const ( type cachingFS struct { fuseutil.NotImplementedFileSystem + + ///////////////////////// + // Constant data + ///////////////////////// + + lookupEntryTimeout time.Duration + getattrTimeout time.Duration + + ///////////////////////// + // Mutable state + ///////////////////////// + mu syncutil.InvariantMutex // The current ID of the lowest numbered non-root inode. @@ -250,7 +264,7 @@ func (fs *cachingFS) LookUpInode( // Fill in the response. resp.Entry.Child = id resp.Entry.Attributes = attrs - resp.Entry.EntryExpiration = fs.entryExpiration + resp.Entry.EntryExpiration = time.Now().Add(fs.lookupEntryTimeout) return }