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

Method sync_impl

fdbrpc/include/fdbrpc/AsyncFileEIO.actor.h:416–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

414 }
415
416 ACTOR static Future<Void> sync_impl(int fd, Reference<ErrorInfo> err, bool sync_metadata = false) {
417 state TaskPriority taskID = g_network->getCurrentTask();
418 state Promise<Void> p;
419 state eio_req* r = start_fsync(fd, p, sync_metadata);
420
421 try {
422 wait(p.getFuture());
423 } catch (...) {
424 g_network->setCurrentTask(taskID);
425 eio_cancel(r);
426 throw;
427 }
428 try {
429 // Report any errors from prior write() or truncate() calls
430 err->report();
431
432 if (r->result)
433 error("SyncError", fd, r);
434 wait(delay(0, taskID));
435 return Void();
436 } catch (Error& _e) {
437 state Error e = _e;
438 wait(delay(0, taskID));
439 throw e;
440 }
441 }
442
443 ACTOR static Future<int64_t> size_impl(int fd) {
444 state TaskPriority taskID = g_network->getCurrentTask();

Callers

nothing calls this directly

Calls 8

eio_cancelFunction · 0.85
delayFunction · 0.85
reportMethod · 0.80
errorFunction · 0.50
VoidClass · 0.50
getCurrentTaskMethod · 0.45
getFutureMethod · 0.45
setCurrentTaskMethod · 0.45

Tested by

no test coverage detected