Fixed an ID allocation bug.
parent
bac78088be
commit
968b5dd71a
|
@ -72,10 +72,14 @@ type CachingFS interface {
|
||||||
func NewCachingFS(
|
func NewCachingFS(
|
||||||
lookupEntryTimeout time.Duration,
|
lookupEntryTimeout time.Duration,
|
||||||
getattrTimeout time.Duration) (fs CachingFS, err error) {
|
getattrTimeout time.Duration) (fs CachingFS, err error) {
|
||||||
|
roundUp := func(n fuse.InodeID) fuse.InodeID {
|
||||||
|
return numInodes * ((n + numInodes - 1) / numInodes)
|
||||||
|
}
|
||||||
|
|
||||||
cfs := &cachingFS{
|
cfs := &cachingFS{
|
||||||
lookupEntryTimeout: lookupEntryTimeout,
|
lookupEntryTimeout: lookupEntryTimeout,
|
||||||
getattrTimeout: getattrTimeout,
|
getattrTimeout: getattrTimeout,
|
||||||
baseID: (fuse.RootInodeID + 1 + numInodes - 1) / numInodes,
|
baseID: roundUp(fuse.RootInodeID + 1),
|
||||||
mtime: time.Now(),
|
mtime: time.Now(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue