--- /n/sources/plan9/sys/src/cmd/venti/srv/dat.h Sat Jan 10 10:00:05 2015 +++ /sys/src/cmd/venti/srv/dat.h Sun Jun 28 00:00:00 2026 @@ -175,9 +175,9 @@ struct Config int nsects; /* index sections initialized */ ISect **sects; Bloom *bloom; /* bloom filter */ - u32int bcmem; - u32int mem; - u32int icmem; + uintptr bcmem; + uintptr mem; + uintptr icmem; int queuewrites; char* haddr; char* vaddr; @@ -497,7 +497,7 @@ struct ISect char index[ANameSize]; /* index owning the section */ u32int blocksize; /* size of hash buckets in index */ u32int blockbase; /* address of start of on disk index table */ - u32int blocks; /* total blocks on disk; some may be unused */ + u32int blocks; /* total blocks on disk; some may be unused; good for 32TB only */ u32int start; /* first bucket in this section */ u32int stop; /* limit of buckets in this section */ }; --- /n/sources/plan9/sys/src/cmd/venti/srv/dcache.c Sat Jan 10 10:00:05 2015 +++ /sys/src/cmd/venti/srv/dcache.c Sun Jun 28 00:00:00 2026 @@ -75,11 +75,11 @@ static void flushproc(void*); static void writeproc(void*); void -initdcache(u32int mem) +initdcache(uintptr mem) { DBlock *b, *last; - u32int nblocks, blocksize; - int i; + u32int blocksize; + uintptr nblocks, i; u8int *p; if(mem < maxblocksize * 2) --- /n/sources/plan9/sys/src/cmd/venti/srv/fns.h Sat Jan 10 10:00:05 2015 +++ /sys/src/cmd/venti/srv/fns.h Sun Jun 28 00:00:00 2026 @@ -29,13 +29,13 @@ void delaykickroundproc(void*); void dirtydblock(DBlock*, int); void diskaccess(int); void disksched(void); -void *emalloc(ulong); +void *emalloc(uintptr); void emptydcache(void); void emptyicache(void); void emptylumpcache(void); -void *erealloc(void *, ulong); +void *erealloc(void *, uintptr); char *estrdup(char*); -void *ezmalloc(ulong); +void *ezmalloc(uintptr); Arena *findarena(char *name); int flushciblocks(Arena *arena); void flushdcache(void); @@ -80,13 +80,13 @@ Arena *initarena(Part *part, u64int base, u64int size, u32int blocksize); ArenaPart *initarenapart(Part *part); int initarenasum(void); void initbloomfilter(Index*); -void initdcache(u32int mem); -void initicache(u32int mem); +void initdcache(uintptr mem); +void initicache(uintptr mem); void initicachewrite(void); IEStream *initiestream(Part *part, u64int off, u64int clumps, u32int size); ISect *initisect(Part *part); Index *initindex(char *name, ISect **sects, int n); -void initlumpcache(u32int size, u32int nblocks); +void initlumpcache(uintptr size, u32int nblocks); int initlumpqueues(int nq); Part* initpart(char *name, int mode); void initround(Round*, char*, int); --- /n/sources/plan9/sys/src/cmd/venti/srv/icache.c Sat Jan 10 10:00:05 2015 +++ /sys/src/cmd/venti/srv/icache.c Sun Jun 28 00:00:00 2026 @@ -278,10 +278,9 @@ scachemiss(u64int addr) */ void -initicache(u32int mem0) +initicache(uintptr mem0) { - u32int mem; - int i, entries, scache; + uintptr mem, i, entries, scache; icache.full.l = &icache.lock; @@ -295,7 +294,7 @@ initicache(u32int mem0) scache = 16; if(entries < 1000) entries = 1000; -fprint(2, "icache %,d bytes = %,d entries; %d scache\n", mem0, entries, scache); +fprint(2, "icache %,lld bytes = %,lld entries; %lld scache\n", (vlong)mem0, (vlong)entries, (vlong)scache); icache.clean.prev = icache.clean.next = &icache.clean; icache.dirty.prev = icache.dirty.next = &icache.dirty; --- /n/sources/plan9/sys/src/cmd/venti/srv/lumpcache.c Sat Jan 10 10:00:05 2015 +++ /sys/src/cmd/venti/srv/lumpcache.c Sun Jun 28 00:00:00 2026 @@ -38,7 +38,7 @@ static int upheap(int i, Lump *b); static Lump *bumplump(void); void -initlumpcache(u32int size, u32int nblocks) +initlumpcache(uintptr size, u32int nblocks) { Lump *last, *b; int i; --- /n/sources/plan9/sys/src/cmd/venti/srv/printarenas.c Sat Jan 10 10:00:05 2015 +++ /sys/src/cmd/venti/srv/printarenas.c Sun Jun 28 00:00:00 2026 @@ -78,7 +78,7 @@ threadmain(int argc, char *argv[]) { int i; Index *ix; - u32int bcmem; + uintptr bcmem; bcmem = 0; ARGBEGIN{ --- /n/sources/plan9/sys/src/cmd/venti/srv/printindex.c Sat Jan 10 10:00:05 2015 +++ /sys/src/cmd/venti/srv/printindex.c Sun Jun 28 00:00:00 2026 @@ -64,7 +64,7 @@ threadmain(int argc, char *argv[]) { int i; Index *ix; - u32int bcmem; + uintptr bcmem; bcmem = 0; ARGBEGIN{ --- /n/sources/plan9/sys/src/cmd/venti/srv/printmap.c Sat Jan 10 10:00:05 2015 +++ /sys/src/cmd/venti/srv/printmap.c Sun Jun 28 00:00:00 2026 @@ -14,7 +14,7 @@ Config conf; void threadmain(int argc, char *argv[]) { - u32int bcmem; + uintptr bcmem; int fix; fix = 0; --- /n/sources/plan9/sys/src/cmd/venti/srv/syncindex.c Sat Jan 10 10:00:05 2015 +++ /sys/src/cmd/venti/srv/syncindex.c Sun Jun 28 00:00:00 2026 @@ -15,7 +15,7 @@ Config conf; void threadmain(int argc, char *argv[]) { - u32int bcmem, icmem; + uintptr bcmem, icmem; bcmem = 0; icmem = 0; @@ -45,7 +45,8 @@ threadmain(int argc, char *argv[]) if(bcmem < maxblocksize * (mainindex->narenas + mainindex->nsects * 4 + 16)) bcmem = maxblocksize * (mainindex->narenas + mainindex->nsects * 4 + 16); - if(0) fprint(2, "initialize %d bytes of disk block cache\n", bcmem); + if(0) fprint(2, "initialize %lld bytes of disk block cache\n", + (vlong)bcmem); initdcache(bcmem); initlumpcache(1*1024*1024, 1024/8); initicache(icmem); --- /n/sources/plan9/sys/src/cmd/venti/srv/utils.c Sat Jan 10 10:00:05 2015 +++ /sys/src/cmd/venti/srv/utils.c Sun Jun 28 00:00:00 2026 @@ -139,7 +139,7 @@ now(void) int abortonmem = 1; void * -emalloc(ulong n) +emalloc(uintptr n) { void *p; @@ -147,16 +147,16 @@ emalloc(ulong n) if(p == nil){ if(abortonmem) abort(); - sysfatal("out of memory allocating %lud", n); + sysfatal("out of memory allocating %llud", (uvlong)n); } memset(p, 0xa5, n); setmalloctag(p, getcallerpc(&n)); -if(0)print("emalloc %p-%p by %#p\n", p, (char*)p+n, getcallerpc(&n)); +if(0)print("emalloc %#p-%#p by %#p\n", p, (char*)p+n, getcallerpc(&n)); return p; } void * -ezmalloc(ulong n) +ezmalloc(uintptr n) { void *p; @@ -164,22 +164,22 @@ ezmalloc(ulong n) if(p == nil){ if(abortonmem) abort(); - sysfatal("out of memory allocating %lud", n); + sysfatal("out of memory allocating %llud", (uvlong)n); } memset(p, 0, n); setmalloctag(p, getcallerpc(&n)); -if(0)print("ezmalloc %p-%p by %#p\n", p, (char*)p+n, getcallerpc(&n)); +if(0)print("ezmalloc %#p-%#p by %#p\n", p, (char*)p+n, getcallerpc(&n)); return p; } void * -erealloc(void *p, ulong n) +erealloc(void *p, uintptr n) { p = realloc(p, n); if(p == nil){ if(abortonmem) abort(); - sysfatal("out of memory allocating %lud", n); + sysfatal("out of memory allocating %llud", (uvlong)n); } setrealloctag(p, getcallerpc(&p)); if(0)print("erealloc %p-%p by %#p\n", p, (char*)p+n, getcallerpc(&p)); @@ -190,7 +190,7 @@ char * estrdup(char *s) { char *t; - int n; + uintptr n; n = strlen(s) + 1; t = emalloc(n); --- /n/sources/plan9/sys/src/cmd/venti/srv/checkindex.c Sat Jan 10 10:00:05 2015 +++ /sys/src/cmd/venti/srv/checkindex.c Sun Jun 28 00:00:00 2026 @@ -225,7 +225,7 @@ threadmain(int argc, char *argv[]) Bloom *oldbloom, *newbloom; Part *part; u64int clumps, base; - u32int bcmem; + uintptr bcmem; int fix, skipz, ok; fix = 0; @@ -271,7 +271,7 @@ threadmain(int argc, char *argv[]) } if(bcmem < maxblocksize * (mainindex->narenas + mainindex->nsects * 4 + 16)) bcmem = maxblocksize * (mainindex->narenas + mainindex->nsects * 4 + 16); - if(0) fprint(2, "initialize %d bytes of disk block cache\n", bcmem); + if(0) fprint(2, "initialize %lld bytes of disk block cache\n", (vlong)bcmem); initdcache(bcmem); fprint(2, "checkindex: building entry list\n"); --- /n/sources/plan9/sys/src/cmd/venti/srv/clumpstats.c Sat Jan 10 10:00:05 2015 +++ /sys/src/cmd/venti/srv/clumpstats.c Sun Jun 28 00:00:00 2026 @@ -95,7 +95,7 @@ usage(void) void threadmain(int argc, char *argv[]) { - u32int bcmem; + uintptr bcmem; bcmem = 0; @@ -118,7 +118,7 @@ threadmain(int argc, char *argv[]) if(bcmem < maxblocksize * (mainindex->narenas + mainindex->nsects * 4 + 16)) bcmem = maxblocksize * (mainindex->narenas + mainindex->nsects * 4 + 16); - if(0) fprint(2, "initialize %d bytes of disk block cache\n", bcmem); + if(0) fprint(2, "initialize %lld bytes of disk block cache\n", (vlong)bcmem); initdcache(bcmem); clumpstats(mainindex); --- /n/sources/plan9/sys/src/cmd/venti/srv/fixarenas.c Sat Jan 10 10:00:05 2015 +++ /sys/src/cmd/venti/srv/fixarenas.c Sun Jun 28 00:00:00 2026 @@ -17,8 +17,8 @@ #define ROUNDUP(x,n) (((x)+(n)-1)&~((n)-1)) -#pragma varargck type "z" uvlong -#pragma varargck type "z" vlong +#pragma varargck type "Z" uvlong +#pragma varargck type "Z" vlong #pragma varargck type "t" uint enum @@ -612,7 +612,7 @@ showdiffs(uchar *want, uchar *have, int len, Info *info) info->name, u32(want), u32(have)); break; case Z|4: - print("\t%s: correct=%z disk=%z\n", + print("\t%s: correct=%Z disk=%Z\n", info->name, (uvlong)u32(want), (uvlong)u32(have)); break; case D|8: @@ -620,7 +620,7 @@ showdiffs(uchar *want, uchar *have, int len, Info *info) info->name, u64(want), u64(have)); break; case Z|8: - print("\t%s: correct=%z disk=%z\n", + print("\t%s: correct=%Z disk=%Z\n", info->name, u64(want), u64(have)); break; case S|ANameSize: @@ -727,9 +727,9 @@ guessgeometry(void) n = 0; } } - print("arena size likely %z (%d of %d)\n", bestdiff, bestn, ndiff); + print("arena size likely %Z (%d of %d)\n", bestdiff, bestn, ndiff); if(arenasize != 0 && arenasize != bestdiff) - print("using user-specified size %z instead\n", arenasize); + print("using user-specified size %Z instead\n", arenasize); else arenasize = bestdiff; @@ -763,9 +763,9 @@ guessgeometry(void) n = 0; } } - print("block size likely %z (%d of %d)\n", bestdiff, bestn, ndiff); + print("block size likely %Z (%d of %d)\n", bestdiff, bestn, ndiff); if(ap.blocksize != 0 && ap.blocksize != bestdiff) - print("using user-specified size %z instead\n", (vlong)ap.blocksize); + print("using user-specified size %Z instead\n", (vlong)ap.blocksize); else ap.blocksize = bestdiff; if(ap.blocksize == 0 || ap.blocksize&(ap.blocksize-1)) @@ -816,7 +816,7 @@ guessgeometry(void) } } p = pagein(ap.arenabase, Block); - print("arena base likely %z%s\n", (vlong)ap.arenabase, + print("arena base likely %Z%s\n", (vlong)ap.arenabase, u32(p)!=ArenaHeadMagic ? " (but no arena head there)" : ""); ap.tabsize = ap.arenabase - ap.tabbase; @@ -1628,7 +1628,9 @@ Again: } if(ci >= eci || cit < ecit){ print("ran out of space editing existing directory; rewriting\n"); - print("# eci %ld ci %ld ecit %ld cit %ld\n", eci-bci, ci-bci, ecit-bcit, cit-bcit); + print("# eci %lld ci %lld ecit %lld cit %lld\n", + (vlong)(eci-bci), (vlong)(ci-bci), + (vlong)(ecit-bcit), (vlong)(cit-bcit)); assert(smart); /* can't happen second time thru */ smart = 0; goto Again; @@ -1714,7 +1716,7 @@ checkarena(vlong offset, int anum) guessarena(offset, anum, &head, &arena, oldscore, score); if(verbose){ - print("#\tversion=%d name=%s blocksize=%d size=%z", + print("#\tversion=%d name=%s blocksize=%d size=%Z", head.version, head.name, head.blocksize, head.size); if(head.clumpmagic) print(" clumpmagic=%#.8ux", head.clumpmagic); @@ -1833,7 +1835,7 @@ checkmap(void) s = fmtstrflush(&fmt); len = strlen(s); if(len > ap.tabsize){ - print("arena partition map too long: need %z bytes have %z\n", + print("arena partition map too long: need %Z bytes have %Z\n", (vlong)len, (vlong)ap.tabsize); len = ap.tabsize; } --- /n/sources/plan9/sys/src/cmd/venti/srv/unwhack.c Sat Jan 10 10:00:05 2015 +++ /sys/src/cmd/venti/srv/unwhack.c Sun Jun 28 00:00:00 2026 @@ -156,7 +156,9 @@ unwhack(Unwhack *uw, uchar *dst, int ndst, uchar *src, int nsrc) off++; if(off > d - dst){ - snprint(uw->err, WhackErrLen, "offset out of range: off=%d d=%ld len=%d nbits=%d", off, d - dst, len, uwnbits); + snprint(uw->err, WhackErrLen, + "offset out of range: off=%d d=%lld len=%d nbits=%d", + off, (vlong)(d - dst), len, uwnbits); return -1; } if(d + len > dmax){