changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > ventivac / changeset: use different venti block types for variable block sizes: set bit (1<<4), making the first pointer block type 19 (16+3, 1<<4 + Pointertype0).

changeset 80: fb2e789fd6bd
parent 79: 81eaee4f0f64
child 81: 041fb8789dcf
author: Mechiel Lukkien <mechiel@ueber.net>
date: Wed, 18 Jul 2007 14:54:48 +0200
files: appl/lib/vac.b module/vac.m
description: use different venti block types for variable block sizes: set bit (1<<4), making the first pointer block type 19 (16+3, 1<<4 + Pointertype0).
     1.1--- a/appl/lib/vac.b	Wed Jul 18 14:53:15 2007 +0200
     1.2+++ b/appl/lib/vac.b	Wed Jul 18 14:54:48 2007 +0200
     1.3@@ -487,7 +487,10 @@
     1.4 				dsize = 0;
     1.5 			return (0, Entry.new(len f.p[i].d, dsize, flags, f.size, score));
     1.6 		}
     1.7-		(ok, score) := vwrite(f.s, Pointertype0+i, f.p[i].data());
     1.8+		t := Pointertype0+i;
     1.9+		if(f.rabin)
    1.10+			t |= Pointervarmask;
    1.11+		(ok, score) := vwrite(f.s, t, f.p[i].data());
    1.12 		if(ok < 0)
    1.13 			return (-1, nil);
    1.14 		treesize := f.p[i].treesize;
    1.15@@ -544,7 +547,10 @@
    1.16 say(sprint("mkstate, depth=%d", e.depth));
    1.17 	for(i := 0; i < e.depth; i++) {
    1.18 say(sprint("mkstate: reading score=%s", e.score.text()));
    1.19-		d := vread(session, s, Pointertype0+e.depth-1-i, Venti->Maxlumpsize);
    1.20+		t := Pointertype0+e.depth-1-i;
    1.21+		if(f.rabin)
    1.22+			t |= Pointervarmask;
    1.23+		d := vread(session, s, t, Venti->Maxlumpsize);
    1.24 		if(d == nil)
    1.25 			return nil;
    1.26 		p := Page.new(dsize, rabin);
    1.27@@ -780,6 +786,7 @@
    1.28 
    1.29 	for(depth := s.e.depth; depth > 0; depth--) {
    1.30 		dtype := Pointertype0+depth-1;
    1.31+		dtype |= Pointervarmask;
    1.32 		buf := vread(s.session, last, dtype, s.e.psize);
    1.33 		if(buf == nil)
    1.34 			return nil;
     2.1--- a/module/vac.m	Wed Jul 18 14:53:15 2007 +0200
     2.2+++ b/module/vac.m	Wed Jul 18 14:54:48 2007 +0200
     2.3@@ -31,6 +31,7 @@
     2.4 	Metaentrysize:	con 4;
     2.5 
     2.6 	Rootversionvar:	con 3;	# xxx move to venti.m
     2.7+	Pointervarmask:	con (1<<4);	# xxx move to venti.m
     2.8 
     2.9 	Dsize:	con 8*1024;
    2.10