errorFS.ReadFile

geesefs-0-30-9
Aaron Jacobs 2015-08-04 09:00:38 +10:00
parent e5d377b531
commit e6a4db9920
1 changed files with 18 additions and 0 deletions

View File

@ -154,3 +154,21 @@ func (fs *errorFS) OpenFile(
return
}
// LOCKS_EXCLUDED(fs.mu)
func (fs *errorFS) ReadFile(
ctx context.Context,
op *fuseops.ReadFileOp) (err error) {
if fs.transformError(op, &err) {
return
}
if op.Inode != fooInodeID || op.Offset != 0 {
err = fmt.Errorf("Unexpected request: %#v", op)
return
}
op.BytesRead = copy(op.Dst, FooContents)
return
}