From f37a3e396454268074f48517e3773f099846d0e3 Mon Sep 17 00:00:00 2001 From: Frans Kaashoek Date: Tue, 30 Jul 2019 08:54:43 -0400 Subject: Make pin/unpin explicit --- kernel/log.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kernel/log.c') diff --git a/kernel/log.c b/kernel/log.c index 5aea267..59984db 100644 --- a/kernel/log.c +++ b/kernel/log.c @@ -77,7 +77,7 @@ install_trans(void) struct buf *dbuf = bread(log.dev, log.lh.block[tail]); // read dst memmove(dbuf->data, lbuf->data, BSIZE); // copy block to dst bwrite(dbuf); // write dst to disk - dbuf->refcnt--; // unpin buffer from cache + bunpin(dbuf); brelse(lbuf); brelse(dbuf); } @@ -229,7 +229,7 @@ log_write(struct buf *b) } log.lh.block[i] = b->blockno; if (i == log.lh.n) { // Add new block to log? - b->refcnt++; // Pin block in cache + bpin(b); log.lh.n++; } release(&log.lock); -- cgit v1.2.3