errorFS.ReadFile
parent
e5d377b531
commit
e6a4db9920
|
@ -154,3 +154,21 @@ func (fs *errorFS) OpenFile(
|
||||||
|
|
||||||
return
|
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
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue