From 3ee5ddb90868066b70f78109cff63119cccdad46 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Fri, 27 Feb 2015 11:55:00 +1100 Subject: [PATCH] Defined inode IDs. --- samples/hello_fs.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/samples/hello_fs.go b/samples/hello_fs.go index 8f27717..16d6777 100644 --- a/samples/hello_fs.go +++ b/samples/hello_fs.go @@ -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 }