| 376 | } |
| 377 | |
| 378 | ACTOR static Future<Void> truncate_impl(int fd, Reference<ErrorInfo> err, int64_t size) { |
| 379 | state TaskPriority taskID = g_network->getCurrentTask(); |
| 380 | state Promise<Void> p; |
| 381 | state eio_req* r = eio_ftruncate(fd, size, 0, eio_callback, &p); |
| 382 | try { |
| 383 | wait(p.getFuture()); |
| 384 | } catch (...) { |
| 385 | g_network->setCurrentTask(taskID); |
| 386 | eio_cancel(r); |
| 387 | throw; |
| 388 | } |
| 389 | if (r->result) |
| 390 | error("TruncateError", fd, r, err); |
| 391 | wait(delay(0, taskID)); |
| 392 | return Void(); |
| 393 | } |
| 394 | |
| 395 | static eio_req* start_fsync(int fd, Promise<Void>& p, bool sync_metadata) { |
| 396 | #ifdef __APPLE__ |
nothing calls this directly
no test coverage detected