log 48 log.c struct log log; log 60 log.c initlock(&log.lock, "log"); log 62 log.c log.start = sb.logstart; log 63 log.c log.size = sb.nlog; log 64 log.c log.dev = dev; log 74 log.c for (tail = 0; tail < log.lh.n; tail++) { log 75 log.c struct buf *lbuf = bread(log.dev, log.start+tail+1); // read log block log 76 log.c struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst log 88 log.c struct buf *buf = bread(log.dev, log.start); log 91 log.c log.lh.n = lh->n; log 92 log.c for (i = 0; i < log.lh.n; i++) { log 93 log.c log.lh.block[i] = lh->block[i]; log 104 log.c struct buf *buf = bread(log.dev, log.start); log 107 log.c hb->n = log.lh.n; log 108 log.c for (i = 0; i < log.lh.n; i++) { log 109 log.c hb->block[i] = log.lh.block[i]; log 120 log.c log.lh.n = 0; log 128 log.c acquire(&log.lock); log 130 log.c if(log.committing){ log 131 log.c sleep(&log, &log.lock); log 132 log.c } else if(log.lh.n + (log.outstanding+1)*MAXOPBLOCKS > LOGSIZE){ log 134 log.c sleep(&log, &log.lock); log 136 log.c log.outstanding += 1; log 137 log.c release(&log.lock); log 150 log.c acquire(&log.lock); log 151 log.c log.outstanding -= 1; log 152 log.c if(log.committing) log 154 log.c if(log.outstanding == 0){ log 156 log.c log.committing = 1; log 161 log.c wakeup(&log); log 163 log.c release(&log.lock); log 169 log.c acquire(&log.lock); log 170 log.c log.committing = 0; log 171 log.c wakeup(&log); log 172 log.c release(&log.lock); log 182 log.c for (tail = 0; tail < log.lh.n; tail++) { log 183 log.c struct buf *to = bread(log.dev, log.start+tail+1); // log block log 184 log.c struct buf *from = bread(log.dev, log.lh.block[tail]); // cache block log 195 log.c if (log.lh.n > 0) { log 199 log.c log.lh.n = 0; log 218 log.c if (log.lh.n >= LOGSIZE || log.lh.n >= log.size - 1) log 220 log.c if (log.outstanding < 1) log 223 log.c acquire(&log.lock); log 224 log.c for (i = 0; i < log.lh.n; i++) { log 225 log.c if (log.lh.block[i] == b->blockno) // log absorbtion log 228 log.c log.lh.block[i] = b->blockno; log 229 log.c if (i == log.lh.n) log 230 log.c log.lh.n++; log 232 log.c release(&log.lock);