updateSize updates the size of the file if necessary Must be called with fh.mu held
()
| 138 | // |
| 139 | // Must be called with fh.mu held |
| 140 | func (fh *RWFileHandle) updateSize() { |
| 141 | // If read only or not opened then ignore |
| 142 | if fh.readOnly() || !fh.opened { |
| 143 | return |
| 144 | } |
| 145 | size := fh._size() |
| 146 | fh.file.setSize(size) |
| 147 | } |
| 148 | |
| 149 | // close the file handle returning EBADF if it has been |
| 150 | // closed already. |