MCPcopy Create free account
hub / github.com/apple/foundationdb / truncate_impl

Method truncate_impl

fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h:378–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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__

Callers

nothing calls this directly

Calls 8

eio_ftruncateFunction · 0.85
eio_cancelFunction · 0.85
delayFunction · 0.85
errorFunction · 0.50
VoidClass · 0.50
getCurrentTaskMethod · 0.45
getFutureMethod · 0.45
setCurrentTaskMethod · 0.45

Tested by

no test coverage detected