diff options
author | David Swasey <david.swasey@gmail.com> | 2010-04-13 13:18:12 -0700 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2010-04-13 13:18:12 -0700 |
commit | 7771477e15d445613891c408a4f4d528f35ab549 (patch) | |
tree | 71bbbfe6823574e238ef2055fd463d38a132c4f6 /src/cmd/vac | |
parent | 7b08cf334b613a777a64ce41565b771d98740faf (diff) | |
download | plan9port-7771477e15d445613891c408a4f4d528f35ab549.tar.gz plan9port-7771477e15d445613891c408a4f4d528f35ab549.tar.bz2 plan9port-7771477e15d445613891c408a4f4d528f35ab549.zip |
vac: eliminated vac cache size 128. vacfsopen used to take ncache rather than cachemem
R=rsc
CC=codebot
http://codereview.appspot.com/817041
Diffstat (limited to 'src/cmd/vac')
-rw-r--r-- | src/cmd/vac/vac.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/cmd/vac/vac.c b/src/cmd/vac/vac.c index bf5118b4..5f896310 100644 --- a/src/cmd/vac/vac.c +++ b/src/cmd/vac/vac.c @@ -15,6 +15,7 @@ usage(void) enum { BlockSize = 8*1024, + CacheSize = 4<<20, }; struct @@ -168,10 +169,10 @@ threadmain(int argc, char **argv) if((outfd = create(archivefile, OWRITE, 0666)) < 0) sysfatal("create %s: %r", archivefile); atexit(removevacfile); // because it is new - if((fs = vacfscreate(z, blocksize, 4<<20)) == nil) + if((fs = vacfscreate(z, blocksize, CacheSize)) == nil) sysfatal("vacfscreate: %r"); }else{ - if((fs = vacfsopen(z, archivefile, VtORDWR, 4<<20)) == nil) + if((fs = vacfsopen(z, archivefile, VtORDWR, CacheSize)) == nil) sysfatal("vacfsopen %s: %r", archivefile); if((fdiff = recentarchive(fs, oldpath)) != nil){ if(verbose) @@ -211,13 +212,13 @@ threadmain(int argc, char **argv) else if((outfd = create(vacfile, OWRITE, 0666)) < 0) sysfatal("create %s: %r", vacfile); atexit(removevacfile); - if((fs = vacfscreate(z, blocksize, 4<<20)) == nil) + if((fs = vacfscreate(z, blocksize, CacheSize)) == nil) sysfatal("vacfscreate: %r"); f = vacfsgetroot(fs); fdiff = nil; if(diffvac){ - if((fsdiff = vacfsopen(z, diffvac, VtOREAD, 128)) == nil) + if((fsdiff = vacfsopen(z, diffvac, VtOREAD, CacheSize)) == nil) warn("vacfsopen %s: %r", diffvac); else fdiff = vacfsgetroot(fsdiff); @@ -708,7 +709,7 @@ vacmerge(VacFile *fp, char *name) if(strlen(name) < 4 || strcmp(name+strlen(name)-4, ".vac") != 0) return -1; - if((mfs = vacfsopen(z, name, VtOREAD, 4<<20)) == nil) + if((mfs = vacfsopen(z, name, VtOREAD, CacheSize)) == nil) return -1; if(verbose) fprint(2, "merging %s\n", name); |