Fixed a build error.

geesefs-0-30-9
Aaron Jacobs 2015-03-17 13:34:50 +11:00
parent cea0fb8b48
commit 7cddc48c24
1 changed files with 17 additions and 3 deletions

View File

@ -72,8 +72,10 @@ func NewCachingFS(
lookupEntryTimeout time.Duration, lookupEntryTimeout time.Duration,
getattrTimeout time.Duration) (fs CachingFS, err error) { getattrTimeout time.Duration) (fs CachingFS, err error) {
cfs := &cachingFS{ cfs := &cachingFS{
baseID: (fuse.RootInodeID + 1 + numInodes - 1) / numInodes, lookupEntryTimeout: lookupEntryTimeout,
mtime: time.Now(), getattrTimeout: getattrTimeout,
baseID: (fuse.RootInodeID + 1 + numInodes - 1) / numInodes,
mtime: time.Now(),
} }
cfs.mu = syncutil.NewInvariantMutex(cfs.checkInvariants) cfs.mu = syncutil.NewInvariantMutex(cfs.checkInvariants)
@ -93,6 +95,18 @@ const (
type cachingFS struct { type cachingFS struct {
fuseutil.NotImplementedFileSystem fuseutil.NotImplementedFileSystem
/////////////////////////
// Constant data
/////////////////////////
lookupEntryTimeout time.Duration
getattrTimeout time.Duration
/////////////////////////
// Mutable state
/////////////////////////
mu syncutil.InvariantMutex mu syncutil.InvariantMutex
// The current ID of the lowest numbered non-root inode. // The current ID of the lowest numbered non-root inode.
@ -250,7 +264,7 @@ func (fs *cachingFS) LookUpInode(
// Fill in the response. // Fill in the response.
resp.Entry.Child = id resp.Entry.Child = id
resp.Entry.Attributes = attrs resp.Entry.Attributes = attrs
resp.Entry.EntryExpiration = fs.entryExpiration resp.Entry.EntryExpiration = time.Now().Add(fs.lookupEntryTimeout)
return return
} }