diff options
| author | forsyth <forsyth@vitanuova.com> | 2010-02-05 15:56:39 +0000 |
|---|---|---|
| committer | forsyth <forsyth@vitanuova.com> | 2010-02-05 15:56:39 +0000 |
| commit | db5567136a1094052c5a4a409b5614bd98514910 (patch) | |
| tree | b0e0629af8305164d7488c5a0225f451533e1eed | |
| parent | 6bf3ce61406f2f25d9da051cd29cb00fcbe539da (diff) | |
20100205-1556
| -rw-r--r-- | CHANGES | 1 | ||||
| -rw-r--r-- | appl/cmd/vacfs.b | 22 | ||||
| -rw-r--r-- | dis/vacfs.dis | bin | 8273 -> 8305 bytes |
3 files changed, 13 insertions, 10 deletions
@@ -3,6 +3,7 @@ update man pages to replace references to sys-dial(2) by dial(2) add DragonFly files (from fgudin and extrudedaluminiu, issue 181); possibly should automatically keep aligned with FreeBSD fpe handling in OpenBSD and FreeBSD [mechiel, issue 190] + appl/cmd/vacfs.b apply fix from mechiel [issue 204] 20100203 appl/lib/cfg.b treat \r as white space [issue 69, issue 70] add u64int to lib9.h files that needed it diff --git a/appl/cmd/vacfs.b b/appl/cmd/vacfs.b index 54e9b57b..f707f568 100644 --- a/appl/cmd/vacfs.b +++ b/appl/cmd/vacfs.b @@ -54,7 +54,7 @@ Elem: adt { Qdir: adt { qid: int; - cqids: list of (big, int); + cqids: list of (string, int); # name, qid }; elems := array[512] of list of ref Elem; @@ -63,21 +63,21 @@ lastqid := 0; qidscores: list of (string, int); -childget(qid: int, vqid: big): ref Elem +childget(qid: int, name: string): ref Elem { for(l := qids[qid % len qids]; l != nil; l = tl l) { if((hd l).qid != qid) continue; for(m := (hd l).cqids; m != nil; m = tl m) { - (vq, cq) := hd m; - if(vq == vqid) + (cname, cq) := hd m; + if(name == cname) return get(cq); } } return nil; } -childput(qid: int, vqid: big): int +childput(qid: int, name: string): int { qd: ref Qdir; for(l := qids[qid % len qids]; l != nil; l = tl l) @@ -89,7 +89,7 @@ childput(qid: int, vqid: big): int qd = ref Qdir(qid, nil); qids[qid % len qids] = qd::nil; } - qd.cqids = (vqid, ++lastqid)::qd.cqids; + qd.cqids = (name, ++lastqid)::qd.cqids; return lastqid; } @@ -154,9 +154,9 @@ walk(ed: ref Elem.Dir, name: string): (ref Elem, string) de := ed.vd.walk(name); if(de == nil) return (nil, sprint("%r")); - ne := childget(ed.qid, de.qid); + ne := childget(ed.qid, de.elem); if(ne == nil) { - nqid := childput(ed.qid, de.qid); + nqid := childput(ed.qid, de.elem); ne = Elem.new(nqid, ed.vd, de, ed.qid); if(ne == nil) return (nil, sprint("%r")); @@ -379,6 +379,7 @@ loop: if(n.offset == 0) { ed.vd.rewind(); ed.offset = 0; + ed.nprev = 0; ed.prev = array[0] of ref Sys->Dir; } skip := n.offset-ed.offset; @@ -401,14 +402,15 @@ loop: } if(de == nil) break; - ne := childget(ed.qid, de.qid); + ne := childget(ed.qid, de.elem); if(ne == nil) { - nqid := childput(ed.qid, de.qid); + nqid := childput(ed.qid, de.elem); ne = Elem.new(nqid, ed.vd, de, ed.qid); if(ne == nil) { n.reply <-= (nil, sprint("%r")); continue loop; } + set(ne); } d := ne.stat(); ed.prev[ed.nprev++] = d; diff --git a/dis/vacfs.dis b/dis/vacfs.dis Binary files differindex 87bf135b..a05ec1b9 100644 --- a/dis/vacfs.dis +++ b/dis/vacfs.dis |
