flushFS.GetInodeAttributes
parent
d7fec86069
commit
38e2aaff58
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue