Fixed more errors.
parent
fc3e144abf
commit
ca8df835f6
|
@ -79,7 +79,7 @@ func NewCachingFS(
|
||||||
cfs := &cachingFS{
|
cfs := &cachingFS{
|
||||||
lookupEntryTimeout: lookupEntryTimeout,
|
lookupEntryTimeout: lookupEntryTimeout,
|
||||||
getattrTimeout: getattrTimeout,
|
getattrTimeout: getattrTimeout,
|
||||||
baseID: roundUp(fuse.RootInodeID + 1),
|
baseID: roundUp(fuseops.RootInodeID + 1),
|
||||||
mtime: time.Now(),
|
mtime: time.Now(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ type cachingFS struct {
|
||||||
|
|
||||||
// The current ID of the lowest numbered non-root inode.
|
// The current ID of the lowest numbered non-root inode.
|
||||||
//
|
//
|
||||||
// INVARIANT: baseID > fuse.RootInodeID
|
// INVARIANT: baseID > fuseops.RootInodeID
|
||||||
// INVARIANT: baseID % numInodes == 0
|
// INVARIANT: baseID % numInodes == 0
|
||||||
//
|
//
|
||||||
// GUARDED_BY(mu)
|
// GUARDED_BY(mu)
|
||||||
|
@ -129,9 +129,9 @@ type cachingFS struct {
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
func (fs *cachingFS) checkInvariants() {
|
func (fs *cachingFS) checkInvariants() {
|
||||||
// INVARIANT: baseID > fuse.RootInodeID
|
// INVARIANT: baseID > fuseops.RootInodeID
|
||||||
// INVARIANT: baseID % numInodes == 0
|
// INVARIANT: baseID % numInodes == 0
|
||||||
if fs.baseID <= fuse.RootInodeID || fs.baseID%numInodes != 0 {
|
if fs.baseID <= fuseops.RootInodeID || fs.baseID%numInodes != 0 {
|
||||||
panic(fmt.Sprintf("Bad baseID: %v", fs.baseID))
|
panic(fmt.Sprintf("Bad baseID: %v", fs.baseID))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -233,14 +233,11 @@ func (fs *cachingFS) SetMtime(mtime time.Time) {
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
// FileSystem methods
|
// Op methods
|
||||||
////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
func (fs *cachingFS) Init(
|
func (fs *cachingFS) init(op *fuseops.InitOp) {
|
||||||
ctx context.Context,
|
op.Respond(nil)
|
||||||
req *fuse.InitRequest) (resp *fuse.InitResponse, err error) {
|
|
||||||
resp = &fuse.InitResponse{}
|
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// LOCKS_EXCLUDED(fs.mu)
|
// LOCKS_EXCLUDED(fs.mu)
|
||||||
|
@ -259,7 +256,7 @@ func (fs *cachingFS) LookUpInode(
|
||||||
switch req.Name {
|
switch req.Name {
|
||||||
case "foo":
|
case "foo":
|
||||||
// Parent must be the root.
|
// Parent must be the root.
|
||||||
if req.Parent != fuse.RootInodeID {
|
if req.Parent != fuseops.RootInodeID {
|
||||||
err = fuse.ENOENT
|
err = fuse.ENOENT
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -269,7 +266,7 @@ func (fs *cachingFS) LookUpInode(
|
||||||
|
|
||||||
case "dir":
|
case "dir":
|
||||||
// Parent must be the root.
|
// Parent must be the root.
|
||||||
if req.Parent != fuse.RootInodeID {
|
if req.Parent != fuseops.RootInodeID {
|
||||||
err = fuse.ENOENT
|
err = fuse.ENOENT
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -279,7 +276,7 @@ func (fs *cachingFS) LookUpInode(
|
||||||
|
|
||||||
case "bar":
|
case "bar":
|
||||||
// Parent must be dir.
|
// Parent must be dir.
|
||||||
if req.Parent == fuse.RootInodeID || req.Parent%numInodes != dirOffset {
|
if req.Parent == fuseops.RootInodeID || req.Parent%numInodes != dirOffset {
|
||||||
err = fuse.ENOENT
|
err = fuse.ENOENT
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -314,7 +311,7 @@ func (fs *cachingFS) GetInodeAttributes(
|
||||||
var attrs fuseops.InodeAttributes
|
var attrs fuseops.InodeAttributes
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case req.Inode == fuse.RootInodeID:
|
case req.Inode == fuseops.RootInodeID:
|
||||||
attrs = fs.rootAttrs()
|
attrs = fs.rootAttrs()
|
||||||
|
|
||||||
case req.Inode%numInodes == fooOffset:
|
case req.Inode%numInodes == fooOffset:
|
||||||
|
|
Loading…
Reference in New Issue