Implemented Init.
parent
3e8995eb7e
commit
236b1ef9df
|
@ -20,6 +20,7 @@ import (
|
||||||
|
|
||||||
"github.com/jacobsa/fuse"
|
"github.com/jacobsa/fuse"
|
||||||
"github.com/jacobsa/fuse/fuseutil"
|
"github.com/jacobsa/fuse/fuseutil"
|
||||||
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Constants that define the relative offsets of the inodes exported by the
|
// Constants that define the relative offsets of the inodes exported by the
|
||||||
|
@ -95,17 +96,7 @@ type cachingFS struct {
|
||||||
mtime time.Time
|
mtime time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cause inodes to receive IDs according to the following rules in further
|
// LOCKS_EXCLUDED(fs.mu)
|
||||||
// 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
|
|
||||||
func (fs *cachingFS) RenumberInodes(base fuse.InodeID) {
|
func (fs *cachingFS) RenumberInodes(base fuse.InodeID) {
|
||||||
fs.mu.Lock()
|
fs.mu.Lock()
|
||||||
defer fs.mu.Unlock()
|
defer fs.mu.Unlock()
|
||||||
|
@ -113,11 +104,17 @@ func (fs *cachingFS) RenumberInodes(base fuse.InodeID) {
|
||||||
fs.inodeIDBase = base
|
fs.inodeIDBase = base
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cause further queries for the attributes of inodes to use the supplied time
|
// LOCKS_EXCLUDED(fs.mu)
|
||||||
// as the inode's mtime.
|
|
||||||
func (fs *cachingFS) SetMtime(mtime time.Time) {
|
func (fs *cachingFS) SetMtime(mtime time.Time) {
|
||||||
fs.mu.Lock()
|
fs.mu.Lock()
|
||||||
defer fs.mu.Unlock()
|
defer fs.mu.Unlock()
|
||||||
|
|
||||||
fs.mtime = mtime
|
fs.mtime = mtime
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fs *cachingFS) Init(
|
||||||
|
ctx context.Context,
|
||||||
|
req *fuse.InitRequest) (resp *fuse.InitResponse, err error) {
|
||||||
|
resp = &fuse.InitResponse{}
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue