_size returns the size of the underlying file and also sets it in the owning file call with the lock held
()
| 221 | // |
| 222 | // call with the lock held |
| 223 | func (fh *RWFileHandle) _size() int64 { |
| 224 | size, err := fh.item.GetSize() |
| 225 | if err != nil { |
| 226 | o := fh.file.getObject() |
| 227 | if o != nil { |
| 228 | size = o.Size() |
| 229 | } else { |
| 230 | fs.Errorf(fh.logPrefix(), "Couldn't read size of file") |
| 231 | size = 0 |
| 232 | } |
| 233 | } |
| 234 | fh.file.setSize(size) |
| 235 | return size |
| 236 | } |
| 237 | |
| 238 | // Size returns the size of the underlying file |
| 239 | func (fh *RWFileHandle) Size() int64 { |
no test coverage detected