cfs/src/FsProc_Journal.cc
// called whenever a journal write completes
called whenever a journal write completes
called whenever a journal write completes
void JournalManager::writeComplete(void *arg,
                                   const struct spdk_nvme_cpl *completion) {
  JournalEntry *je = (JournalEntry *)arg;
  JournalManager *mgr = je->getManager();
  if (spdk_nvme_cpl_is_error(completion)) {
    je->state = JournalEntryState::FAILURE;
    goto end;
  }
  switch (je->state) {
    case JournalEntryState::WRITE_BODY:
      je->state = JournalEntryState::FLUSH;
      break;
    case JournalEntryState::FLUSH:
      je->state = JournalEntryState::WRITE_COMMIT;
      break;
    case JournalEntryState::WRITE_COMMIT:
      je->state = JournalEntryState::SUCCESS;
      break;
    default:
      assert(false);
  }
end:
  if (kEnableNvmeWriteStats) {
    mgr->n_num_nvme_write_done_++;
  }
  mgr->processJournalEntry(je);
}
void JournalManager :: writeComplete ( void * arg , const struct spdk_nvme_cpl * completion ) { JournalEntry * je = ( JournalEntry * ) arg ; JournalManager * mgr = je -> getManager ( ) ; if ( spdk_nvme_cpl_is_error ( completion ) ) { je -> state = JournalEntryState :: FAILURE ; goto end ; } switch ( je -> state ) { case JournalEntryState :: WRITE_BODY : je -> state = JournalEntryState :: FLUSH ; break ; case JournalEntryState :: FLUSH : je -> state = JournalEntryState :: WRITE_COMMIT ; break ; case JournalEntryState :: WRITE_COMMIT : je -> state = JournalEntryState :: SUCCESS ; break ; default : assert ( false ) ; } end : if ( kEnableNvmeWriteStats ) { mgr -> n_num_nvme_write_done_ ++ ; } mgr -> processJournalEntry ( je ) ; }
called whenever a journal write completes
called whenever a journal write completes
// TODO add more information about which state this failure occurred...