summaryrefslogtreecommitdiff
path: root/sys/lib
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-11-08 22:31:26 +0100
committercinap_lenrek <cinap_lenrek@gmx.de>2013-11-08 22:31:26 +0100
commit2bc9e8e5e3b3eab7063c718fc6711b0a1cd14dbe (patch)
tree70d785f0e8d268ba48d6626e18e647761f546773 /sys/lib
parent18e515511f45c115acbed2dc40dd1895b2ea6890 (diff)
kernel: make image cache not hold onto the channel, remove nocache flag
the image cache should not hold onto the text file channel when not neccesary. now, the image keeps track of the number of page cache references in Image.pgref. if the number of page cache references and Image.ref are equal, this means all the references to this image are from the page cache. so no segments are using this image. in that case, we can close the channel, but keep the Image in the hash table. when attachimage() finds our image, it will check if Image.c is nil and reattach the channel to the image before it is used. the Image.nocache flag isnt needed anymore.
Diffstat (limited to 'sys/lib')
-rw-r--r--sys/lib/acid/kernel11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/lib/acid/kernel b/sys/lib/acid/kernel
index 7d082ec12..688357a2e 100644
--- a/sys/lib/acid/kernel
+++ b/sys/lib/acid/kernel
@@ -29,9 +29,18 @@ defn path(p) {
// print Image cache contents
IHASHSIZE = 64;
defn imagecacheline(h) {
+ local d, p, q;
+
while h != 0 do {
complex Image h;
- print (h\X, " ", qid(h.qid), " type ", h.type\D, " ref ", h.ref, " next ", h.next\X, " ", path(h.c.path), "\n");
+
+ d=(Dev)(*(devtab+4*h.type));
+ p = "*closed*";
+ if h.c != 0 then
+ p = path(h.c.path);
+ q = h.qid;
+ print (h\X, " ref=", h.ref, " pgref=", h.pgref, "\t#", d.dc\r, h.dev\D, " (",
+ q.path, " ", q.vers\D, " ", q.type\X, ") ", p, "\n");
h = h.hash;
}
}