changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > ventivac / changeset: slightly clearer

changeset 107: f59da92b57d9
parent 106: 5c7c019578cf
child 108: 35094d0d4a2b
author: Mechiel Lukkien <mechiel@ueber.net>
date: Thu, 16 Aug 2007 00:45:46 +0200
files: appl/cmd/vacfs.b
description: slightly clearer
     1.1--- a/appl/cmd/vacfs.b	Wed Aug 15 20:54:13 2007 +0200
     1.2+++ b/appl/cmd/vacfs.b	Thu Aug 16 00:45:46 2007 +0200
     1.3@@ -51,13 +51,13 @@
     1.4 	stat:	fn(e: self ref Elem): ref Sys->Dir;
     1.5 };
     1.6 
     1.7-Qdir: adt {
     1.8+Qidmap: adt {
     1.9 	qid:	int;
    1.10 	cqids:	list of (big, int);
    1.11 };
    1.12 
    1.13 elems := array[512] of list of ref Elem;
    1.14-qids := array[512] of list of ref Qdir;
    1.15+qidmaps:= array[512] of list of ref Qidmap;
    1.16 lastqid := 0;
    1.17 qidscores: list of (string, int);
    1.18 
    1.19@@ -128,7 +128,6 @@
    1.20 		red = Elem.mkdir(rqid, de, big 0, vd, rqid);
    1.21 	}
    1.22 	set(red);
    1.23-	say(sprint("have root, qid=%d", rqid));
    1.24 
    1.25 	navchan := chan of ref Navop;
    1.26 	nav := Navigator.new(navchan);
    1.27@@ -145,7 +144,7 @@
    1.28 			break serve;
    1.29 
    1.30 		Read =>
    1.31-			say(sprint("have read, offset=%ubd count=%d", m.offset, m.count));
    1.32+			if(dflag) say(sprint("have read, offset=%ubd count=%d", m.offset, m.count));
    1.33 			(c, err) := srv.canread(m);
    1.34 			if(c == nil){
    1.35 				srv.reply(ref Rmsg.Error(m.tag, err));
    1.36@@ -279,7 +278,7 @@
    1.37 
    1.38 childget(qid: int, vqid: big): int
    1.39 {
    1.40-	for(l := qids[qid % len qids]; l != nil; l = tl l) {
    1.41+	for(l := qidmaps[qid % len qidmaps]; l != nil; l = tl l) {
    1.42 		if((hd l).qid != qid)
    1.43 			continue;
    1.44 		for(m := (hd l).cqids; m != nil; m = tl m) {
    1.45@@ -293,15 +292,15 @@
    1.46 
    1.47 childput(qid: int, vqid: big): int
    1.48 {
    1.49-	qd: ref Qdir;
    1.50-	for(l := qids[qid % len qids]; l != nil; l = tl l)
    1.51+	qd: ref Qidmap;
    1.52+	for(l := qidmaps[qid % len qidmaps]; l != nil; l = tl l)
    1.53 		if((hd l).qid == qid) {
    1.54 			qd = hd l;
    1.55 			break;
    1.56 		}
    1.57 	if(qd == nil) {
    1.58-		qd = ref Qdir(qid, nil);
    1.59-		qids[qid % len qids] = qd::nil;
    1.60+		qd = ref Qidmap(qid, nil);
    1.61+		qidmaps[qid % len qidmaps] = qd::nil;
    1.62 	}
    1.63 	qd.cqids = (vqid, ++lastqid)::qd.cqids;
    1.64 	return lastqid;