2021-10-21から1日間の記事一覧

log.c static void read_head(void)

トップページ jupiteroak.hatenablog.com log.c https://github.com/mit-pdos/xv6-public/blob/master/log.c#L85 static void read_head(void) { struct buf *buf = bread(log.dev, log.start); struct logheader *lh = (struct logheader *) (buf->data); i…

log.c static void write_head(void)

トップページ jupiteroak.hatenablog.com log.c https://github.com/mit-pdos/xv6-public/blob/master/log.c#L101 static void write_head(void) { struct buf *buf = bread(log.dev, log.start); struct logheader *hb = (struct logheader *) (buf->data);…

log.c static void write_log(void)

トップページ jupiteroak.hatenablog.com log.c https://github.com/mit-pdos/xv6-public/blob/master/log.c#L177 static void write_log(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { struct buf *to = bread(log.dev, log.start+tail+1);…

log.c static void install_trans(void)

トップページ jupiteroak.hatenablog.com log.c https://github.com/mit-pdos/xv6-public/blob/master/log.c#L69 static void install_trans(void) { int tail; for (tail = 0; tail < log.lh.n; tail++) { struct buf *lbuf = bread(log.dev, log.start+tai…

log.c void log_write(struct buf *b)

トップページ jupiteroak.hatenablog.com log.c https://github.com/mit-pdos/xv6-public/blob/master/log.c#L213 void log_write(struct buf *b) { int i; if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) panic("too big a transaction"); if (log.…

log.c static void commit()

トップページ jupiteroak.hatenablog.com log.c https://github.com/mit-pdos/xv6-public/blob/master/log.c#L192 static void commit() { if (log.lh.n > 0) { write_log(); // Write modified blocks from cache to log write_head(); // Write header to …

log.c void end_op(void)

トップページ jupiteroak.hatenablog.com log.c https://github.com/mit-pdos/xv6-public/blob/master/log.c#L145 void end_op(void) { int do_commit = 0; acquire(&log.lock); log.outstanding -= 1; if(log.committing) panic("log.committing"); if(log.…

log.c void begin_op(void)

トップページ jupiteroak.hatenablog.com log.c https://github.com/mit-pdos/xv6-public/blob/master/log.c#L125 void begin_op(void) { acquire(&log.lock); while(1){ if(log.committing){ sleep(&log, &log.lock); } else if(log.lh.n + (log.outstandin…

log.c static void recover_from_log(void)

トップページ jupiteroak.hatenablog.com log.c https://github.com/mit-pdos/xv6-public/blob/master/log.c#L115 static void recover_from_log(void) { read_head(); install_trans(); // if committed, copy from log to disk log.lh.n = 0; write_head()…

log.c void initlog(int dev)

トップページ jupiteroak.hatenablog.com log.c https://github.com/mit-pdos/xv6-public/blob/master/log.c#L53 void initlog(int dev) { if (sizeof(struct logheader) >= BSIZE) panic("initlog: too big logheader"); struct superblock sb; initlock(&l…