From 236b1ef9dfadac03bea9c1b0c494ebfc88ab3952 Mon Sep 17 00:00:00 2001 From: Aaron Jacobs Date: Tue, 17 Mar 2015 12:55:24 +1100 Subject: [PATCH] Implemented Init. --- samples/cachingfs/caching_fs.go | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/samples/cachingfs/caching_fs.go b/samples/cachingfs/caching_fs.go index 06ca702..4619196 100644 --- a/samples/cachingfs/caching_fs.go +++ b/samples/cachingfs/caching_fs.go @@ -20,6 +20,7 @@ import ( "github.com/jacobsa/fuse" "github.com/jacobsa/fuse/fuseutil" + "golang.org/x/net/context" ) // Constants that define the relative offsets of the inodes exported by the @@ -95,17 +96,7 @@ type cachingFS struct { mtime time.Time } -// Cause inodes to receive IDs according to the following rules in further -// responses to fuse: -// -// * The ID of "foo" is base + FooInodeOffset. -// * The ID of "dir" is base + DirInodeOffset. -// * The ID of "dir/bar" is base + BarInodeOffset. -// -// If this method has never been called, the file system behaves as if it were -// called with base set to fuse.RootInodeID + 1. -// -// REQUIRES: base > fuse.RootInodeID +// LOCKS_EXCLUDED(fs.mu) func (fs *cachingFS) RenumberInodes(base fuse.InodeID) { fs.mu.Lock() defer fs.mu.Unlock() @@ -113,11 +104,17 @@ func (fs *cachingFS) RenumberInodes(base fuse.InodeID) { fs.inodeIDBase = base } -// Cause further queries for the attributes of inodes to use the supplied time -// as the inode's mtime. +// LOCKS_EXCLUDED(fs.mu) func (fs *cachingFS) SetMtime(mtime time.Time) { fs.mu.Lock() defer fs.mu.Unlock() fs.mtime = mtime } + +func (fs *cachingFS) Init( + ctx context.Context, + req *fuse.InitRequest) (resp *fuse.InitResponse, err error) { + resp = &fuse.InitResponse{} + return +}