Defined inode IDs.

geesefs-0-30-9
Aaron Jacobs 2015-02-27 11:55:00 +11:00
parent 2bf317ef16
commit 3ee5ddb908
1 changed files with 8 additions and 1 deletions

View File

@ -24,11 +24,18 @@ type HelloFS struct {
var _ fuse.FileSystem = &HelloFS{}
const (
rootInode fuse.InodeID = fuse.RootInodeID + iota
helloInode
dirInode
worldInode
)
func (fs *HelloFS) OpenDir(
ctx context.Context,
req *fuse.OpenDirRequest) (resp *fuse.OpenDirResponse, err error) {
// We always allow opening the root directory.
if req.Inode == fuse.RootInodeID {
if req.Inode == rootInode {
resp = &fuse.OpenDirResponse{}
return
}