_readAt bytes from the file at off if release is set then it releases the mutex just before doing the IO call with lock held
(b []byte, off int64, release bool)
| 255 | // |
| 256 | // call with lock held |
| 257 | func (fh *RWFileHandle) _readAt(b []byte, off int64, release bool) (n int, err error) { |
| 258 | defer log.Trace(fh.logPrefix(), "size=%d, off=%d", len(b), off)("n=%d, err=%v", &n, &err) |
| 259 | if fh.closed { |
| 260 | return n, ECLOSED |
| 261 | } |
| 262 | if fh.writeOnly() { |
| 263 | return n, EBADF |
| 264 | } |
| 265 | if off >= fh._size() { |
| 266 | return n, io.EOF |
| 267 | } |
| 268 | if err = fh.openPending(); err != nil { |
| 269 | return n, err |
| 270 | } |
| 271 | if release { |
| 272 | // Do the writing with fh.mu unlocked |
| 273 | fh.mu.Unlock() |
| 274 | } |
| 275 | |
| 276 | n, err = fh.item.ReadAt(b, off) |
| 277 | |
| 278 | if release { |
| 279 | fh.mu.Lock() |
| 280 | } |
| 281 | return n, err |
| 282 | } |
| 283 | |
| 284 | // ReadAt bytes from the file at off |
| 285 | func (fh *RWFileHandle) ReadAt(b []byte, off int64) (n int, err error) { |