aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/venti/srv/icachewrite.c
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2007-04-23 14:40:54 +0000
committerrsc <devnull@localhost>2007-04-23 14:40:54 +0000
commit07029cdbbd9be6ad780bd594c98d26babec7ee67 (patch)
tree55c1a64414faa236c67ae710c9aaf2b99aed8be7 /src/cmd/venti/srv/icachewrite.c
parent8d271d6cc3e14e5f7817dfbad2148ca86a6097a6 (diff)
downloadplan9port-07029cdbbd9be6ad780bd594c98d26babec7ee67.tar.gz
plan9port-07029cdbbd9be6ad780bd594c98d26babec7ee67.tar.bz2
plan9port-07029cdbbd9be6ad780bd594c98d26babec7ee67.zip
cleanup
Diffstat (limited to 'src/cmd/venti/srv/icachewrite.c')
-rw-r--r--src/cmd/venti/srv/icachewrite.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/cmd/venti/srv/icachewrite.c b/src/cmd/venti/srv/icachewrite.c
index 003abb18..2d3ed47c 100644
--- a/src/cmd/venti/srv/icachewrite.c
+++ b/src/cmd/venti/srv/icachewrite.c
@@ -110,7 +110,7 @@ icachewritesect(Index *ix, ISect *is, u8int *buf)
trace(TraceProc, "icachewritesect readpart 0x%llux+0x%ux", addr, nbuf);
if(readpart(is->part, addr, buf, nbuf) < 0){
- /* XXX */
+ /* XXX more details here */
fprint(2, "icachewriteproc readpart: %r\n");
err = -1;
continue;
@@ -154,7 +154,18 @@ icachewritesect(Index *ix, ISect *is, u8int *buf)
break;
}
packibucket(&ib, buf+off, is->bucketmagic);
- /* XXX not right - must update cache after writepart */
+ /* XXX
+ * This is not quite right - it's good that we
+ * update the cached block (if any) here, but
+ * since the block doesn't get written until writepart
+ * below, we also need to make sure that the cache
+ * doesn't load the stale block before we write it to
+ * disk below. We could lock the disk cache during
+ * the writepart, but that's pretty annoying.
+ * Another possibility would be never to cache
+ * index partition blocks. The hit rate on those is
+ * miniscule anyway.
+ */
if((b = _getdblock(is->part, naddr, ORDWR, 0)) != nil){
memmove(b->data, buf+off, bsize);
putdblock(b);
@@ -165,7 +176,7 @@ icachewritesect(Index *ix, ISect *is, u8int *buf)
trace(TraceProc, "icachewritesect writepart", addr, nbuf);
if(writepart(is->part, addr, buf, nbuf) < 0){
- /* XXX */
+ /* XXX more details here */
fprint(2, "icachewriteproc writepart: %r\n");
err = -1;
continue;