| 310 | Status Flush() override { return FlushBuffer(); } |
| 311 | |
| 312 | Status Sync() override { |
| 313 | // Ensure new files referred to by the manifest are in the filesystem. |
| 314 | // |
| 315 | // This needs to happen before the manifest file is flushed to disk, to |
| 316 | // avoid crashing in a state where the manifest refers to files that are not |
| 317 | // yet on disk. |
| 318 | Status status = SyncDirIfManifest(); |
| 319 | if (!status.ok()) { |
| 320 | return status; |
| 321 | } |
| 322 | |
| 323 | status = FlushBuffer(); |
| 324 | if (!status.ok()) { |
| 325 | return status; |
| 326 | } |
| 327 | |
| 328 | return SyncFd(fd_, filename_, false); |
| 329 | } |
| 330 | |
| 331 | private: |
| 332 | Status FlushBuffer() { |
no outgoing calls