コード例 #1
0
ファイル: log.c プロジェクト: JackieXie168/xv6-rpi
static void recover_from_log(void)
{
    read_head();
    install_trans(); // if committed, copy from log to disk
    log.lh.n = 0;
    write_head(); // clear the log
}
コード例 #2
0
ファイル: log.c プロジェクト: jlledom/MIT_6.828-xv6
static void
recover_from_log(void)
{
  read_head();      
  cprintf("recovery: n=%d\n", log.lh.n);
  install_trans();
  log.lh.n = 0;
  write_head();
}
コード例 #3
0
ファイル: log.c プロジェクト: jlledom/MIT_6.828-xv6
static void
commit(void)
{
  if (log.lh.n > 0) {
    write_log();     // Write modified blocks from cache to log
    write_head();    // Write header to disk -- the real commit
    install_trans(); // Now install writes to home locations
    log.lh.n = 0;
    write_head();    // Erase the transaction from the log
  }
}
コード例 #4
0
ファイル: log.c プロジェクト: JackieXie168/xv6-rpi
void commit_trans(void)
{
    if (log.lh.n > 0) {
        write_head();    // Write header to disk -- the real commit
        install_trans(); // Now install writes to home locations
        log.lh.n = 0;
        write_head();    // Erase the transaction from the log
    }

    acquire(&log.lock);
    log.busy = 0;
    wakeup(&log);
    release(&log.lock);
}
コード例 #5
0
ファイル: log.c プロジェクト: KWMalik/Homework-3
void
commit_trans(void)
{
  if (log.lh.n > 0) {
    write_head();    // Causes all blocks till log.head to be commited
    install_trans(); // Install all the transactions till head
    log.lh.n = 0; 
    write_head();    // Reclaim log
  }
  
  acquire(&log.lock);
  log.intrans = 0;
  wakeup(&log);
  release(&log.lock);
}