MCPcopy Create free account
hub / github.com/davidgiven/fluxengine / beginRead

Method beginRead

src/gui2/datastore.cc:520–554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

518}
519
520void Datastore::beginRead(bool rereadBadSectors)
521{
522 Events::OperationStart::post("fluxengine.view.status.readDevice"_lang);
523 Datastore::runOnWorkerThread(
524 [=]
525 {
526 busy = true;
527 failed = false;
528 DEFER(wtOperationStop());
529
530 try
531 {
532 wtRebuildConfiguration(true);
533 if (!rereadBadSectors)
534 wtClearDiskData();
535
536 std::shared_ptr<Disk> disk;
537 wtRunSynchronouslyOnUiThread((std::function<void()>)[&] {
538 if (::disk)
539 disk = std::make_shared<Disk>(*::disk);
540 else
541 disk = std::make_shared<Disk>();
542 });
543 auto fluxSource = FluxSource::create(globalConfig());
544 auto decoder = Arch::createDecoder(globalConfig());
545
546 readDiskCommand(*diskLayout, *fluxSource, *decoder, *disk);
547 }
548 catch (...)
549 {
550 failed = true;
551 throw;
552 }
553 });
554}
555
556void Datastore::beginWrite()
557{

Callers

nothing calls this directly

Calls 6

runOnWorkerThreadFunction · 0.85
wtOperationStopFunction · 0.85
wtRebuildConfigurationFunction · 0.85
wtClearDiskDataFunction · 0.85
readDiskCommandFunction · 0.85

Tested by

no test coverage detected