log 47 log.c struct log log; log 59 log.c initlock(&log.lock, "log"); log 61 log.c log.start = sb.logstart; log 62 log.c log.size = sb.nlog; log 63 log.c log.dev = dev; log 73 log.c for (tail = 0; tail < log.lh.n; tail++) { log 74 log.c struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block log 75 log.c struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst log 87 log.c struct buf *buf = bread(log.dev, log.start); log 90 log.c log.lh.n = lh->n; log 91 log.c for (i = 0; i < log.lh.n; i++) { log 92 log.c log.lh.block[i] = lh->block[i]; log 103 log.c struct buf *buf = bread(log.dev, log.start); log 106 log.c hb->n = log.lh.n; log 107 log.c for (i = 0; i < log.lh.n; i++) { log 108 log.c hb->block[i] = log.lh.block[i]; log 119 log.c log.lh.n = 0; log 127 log.c acquire(&log.lock); log 129 log.c if(log.committing){ log 130 log.c sleep(&log, &log.lock); log 131 log.c } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ log 133 log.c sleep(&log, &log.lock); log 135 log.c log.outstanding += 1; log 136 log.c release(&log.lock); log 149 log.c acquire(&log.lock); log 150 log.c log.outstanding -= 1; log 151 log.c if(log.committing) log 153 log.c if(log.outstanding == 0){ log 155 log.c log.committing = 1; log 158 log.c wakeup(&log); log 160 log.c release(&log.lock); log 166 log.c acquire(&log.lock); log 167 log.c log.committing = 0; log 168 log.c wakeup(&log); log 169 log.c release(&log.lock); log 179 log.c for (tail = 0; tail < log.lh.n; tail++) { log 180 log.c struct buf *to = bread(log.dev, log.start+tail+1); // log block log 181 log.c struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block log 192 log.c if (log.lh.n > 0) { log 196 log.c log.lh.n = 0; log 215 log.c if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) log 217 log.c if (log.outstanding < 1) log 220 log.c acquire(&log.lock); log 221 log.c for (i = 0; i < log.lh.n; i++) { log 222 log.c if (log.lh.block[i] == b->blockno) // log absorbtion log 225 log.c log.lh.block[i] = b->blockno; log 226 log.c if (i == log.lh.n) log 227 log.c log.lh.n++; log 229 log.c release(&log.lock);