Store inode in ITNode
This commit is contained in:
parent
0e0bfdc1f4
commit
eb745def04
@ -17,6 +17,7 @@ type ITProperty struct {
|
|||||||
type ITNode struct {
|
type ITNode struct {
|
||||||
fs.Inode
|
fs.Inode
|
||||||
kind int
|
kind int
|
||||||
|
Ino uint64
|
||||||
}
|
}
|
||||||
|
|
||||||
var properties = []ITProperty {
|
var properties = []ITProperty {
|
||||||
@ -75,7 +76,7 @@ func (n *ITNode) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*
|
|||||||
Mode: fuse.S_IFDIR,
|
Mode: fuse.S_IFDIR,
|
||||||
Ino: uint64(0),
|
Ino: uint64(0),
|
||||||
}
|
}
|
||||||
operations := &ITNode{kind: 1}
|
operations := &ITNode{kind: 1, Ino: 0}
|
||||||
child := n.NewInode(ctx, operations, stable)
|
child := n.NewInode(ctx, operations, stable)
|
||||||
return child, 0
|
return child, 0
|
||||||
} else if name == "fs" {
|
} else if name == "fs" {
|
||||||
@ -83,7 +84,7 @@ func (n *ITNode) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*
|
|||||||
Mode: fuse.S_IFDIR,
|
Mode: fuse.S_IFDIR,
|
||||||
Ino: uint64(1),
|
Ino: uint64(1),
|
||||||
}
|
}
|
||||||
operations := &ITNode{kind: 2}
|
operations := &ITNode{kind: 2, Ino: 1}
|
||||||
child := n.NewInode(ctx, operations, stable)
|
child := n.NewInode(ctx, operations, stable)
|
||||||
return child, 0
|
return child, 0
|
||||||
}
|
}
|
||||||
@ -95,7 +96,7 @@ func (n *ITNode) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*
|
|||||||
Mode: fuse.S_IFREG,
|
Mode: fuse.S_IFREG,
|
||||||
Ino: uint64(value.Ino),
|
Ino: uint64(value.Ino),
|
||||||
}
|
}
|
||||||
operations := &ITNode{kind: 3}
|
operations := &ITNode{kind: 3, Ino: value.Ino}
|
||||||
child := n.NewInode(ctx, operations, stable)
|
child := n.NewInode(ctx, operations, stable)
|
||||||
return child, 0
|
return child, 0
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user