Commit ad3a4634 authored by Aaron Jacobs's avatar Aaron Jacobs

Implemented dir methods.

parent 7943ab5b
......@@ -172,3 +172,44 @@ func (fs *errorFS) ReadFile(
return
}
// LOCKS_EXCLUDED(fs.mu)
func (fs *errorFS) OpenDir(
ctx context.Context,
op *fuseops.OpenDirOp) (err error) {
if fs.transformError(op, &err) {
return
}
if op.Inode != fuseops.RootInodeID {
err = fmt.Errorf("Unsupported inode ID: %d", op.Inode)
return
}
return
}
// LOCKS_EXCLUDED(fs.mu)
func (fs *errorFS) ReadDir(
ctx context.Context,
op *fuseops.ReadDirOp) (err error) {
if fs.transformError(op, &err) {
return
}
if op.Inode != fuseops.RootInodeID || op.Offset != 0 {
err = fmt.Errorf("Unexpected request: %#v", op)
return
}
op.BytesRead = fuseutil.WriteDirent(
op.Dst,
fuseutil.Dirent{
Offset: 0,
Inode: fooInodeID,
Name: "foo",
Type: fuseutil.DT_File,
})
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