summaryrefslogtreecommitdiff
path: root/bio.c
diff options
context:
space:
mode:
authorRobert Morris <[email protected]>2017-08-09 06:54:45 -0400
committerRobert Morris <[email protected]>2017-08-09 06:54:45 -0400
commit70705966adb7a055582f76f2ecdb5ce9cd3c8a85 (patch)
tree9c1938e1a71740a3d98b0eed6e66169fc70ecf75 /bio.c
parentda3b931ddbc66da95b916b95e5258f3a506ac521 (diff)
downloadxv6-labs-70705966adb7a055582f76f2ecdb5ce9cd3c8a85.tar.gz
xv6-labs-70705966adb7a055582f76f2ecdb5ce9cd3c8a85.tar.bz2
xv6-labs-70705966adb7a055582f76f2ecdb5ce9cd3c8a85.zip
comment fixes
Diffstat (limited to 'bio.c')
-rw-r--r--bio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bio.c b/bio.c
index fd3a47c..a61ff72 100644
--- a/bio.c
+++ b/bio.c
@@ -75,9 +75,9 @@ bget(uint dev, uint blockno)
}
}
- // Not cached; recycle some unused buffer and clean buffer
- // "clean" because B_DIRTY and not locked means log.c
- // hasn't yet committed the changes to the buffer.
+ // Not cached; recycle an unused buffer.
+ // Even if refcnt==0, B_DIRTY indicates a buffer is in use
+ // because log.c has modified it but not yet committed it.
for(b = bcache.head.prev; b != &bcache.head; b = b->prev){
if(b->refcnt == 0 && (b->flags & B_DIRTY) == 0) {
b->dev = dev;