Commit 38e2aaff authored by Aaron Jacobs's avatar Aaron Jacobs

flushFS.GetInodeAttributes

parent d7fec860
......@@ -48,6 +48,14 @@ type flushFS struct {
// Helpers
////////////////////////////////////////////////////////////////////////
// LOCKS_REQUIRED(fs.mu)
func (fs *flushFS) rootAttributes() fuse.InodeAttributes {
return fuse.InodeAttributes{
Nlink: 1,
Mode: 0777 | os.ModeDir,
}
}
// LOCKS_REQUIRED(fs.mu)
func (fs *flushFS) fooAttributes() fuse.InodeAttributes {
return fuse.InodeAttributes{
......@@ -90,3 +98,27 @@ func (fs *flushFS) LookUpInode(
return
}
func (fs *flushFS) GetInodeAttributes(
ctx context.Context,
req *fuse.GetInodeAttributesRequest) (
resp *fuse.GetInodeAttributesResponse, err error) {
resp = &fuse.GetInodeAttributesResponse{}
fs.mu.Lock()
defer fs.mu.Unlock()
switch req.Inode {
case fuse.RootInodeID:
resp.Attributes = fs.rootAttributes()
return
case fooID:
resp.Attributes = fs.fooAttributes()
return
default:
err = fuse.ENOENT
return
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment