This patch adds two options to vac, -A and -N. -A writes mtimes rather than atimes to the vac archive's atime fields, which may increase block sharing in archives. -N allows the user to specify the name of the vac archive in the root block, which defaulted to the file name or "cons" if -f isn't given. Reference: /n/sources/patch/maybe/vac-noatime Date: Wed Feb 11 02:33:33 CET 2009 Signed-off-by: nwf@cs.jhu.edu --- /sys/src/cmd/vac/vac.c Wed Feb 11 02:32:41 2009 +++ /sys/src/cmd/vac/vac.c Wed Feb 11 02:32:41 2009 @@ -86,9 +86,10 @@ ulong meta; } stats; +int noatimes; int bsize = BlockSize; int maxbsize; -char *oname, *dfile; +char *oname, *dfile, *vname; int verbose; uvlong fileid = 1; int qdiff; @@ -110,6 +111,12 @@ ARGBEGIN{ default: usage(); + case 'A': + noatimes=1; + break; + case 'N': + vname = EARGF(usage()); + break; case 'b': bsize = unittoull(EARGF(usage())); if(bsize == ~0) @@ -189,7 +196,7 @@ static void usage(void) { - fprint(2, "usage: %s [-amqsv] [-h host] [-d vacfile] [-b blocksize] [-i name] [-e exclude] [-f vacfile] file ... \n", argv0); + fprint(2, "usage: %s [-Amqsv] [-h host] [-d vacfile] [-b blocksize] [-i name] [-e exclude] [-N name] [-f vacfile] file ... \n", argv0); exits("usage"); } @@ -338,7 +345,7 @@ memset(&root, 0, sizeof(root)); root.version = VtRootVersion; - strncpy(root.name, dir->name, sizeof(root.name)); + strncpy(root.name, (vname)?vname:dir->name, sizeof(root.name)); root.name[sizeof(root.name)-1] = 0; free(dir); sprint(root.type, "vac"); @@ -1140,7 +1147,7 @@ vd->mtime = dir->mtime; vd->mcount = 0; vd->ctime = dir->mtime; /* ctime: not available on plan 9 */ - vd->atime = dir->atime; + vd->atime = (noatimes)?dir->mtime:dir->atime; vd->mode = dir->mode & 0777; if(dir->mode & DMDIR) --- /sys/man/1/vac Wed Feb 11 02:32:42 2009 +++ /sys/man/1/vac Wed Feb 11 02:32:41 2009 @@ -4,7 +4,7 @@ .SH SYNOPSIS .B vac [ -.B -mqsv +.B -Amqsv ] [ .B -b .I blocksize @@ -70,6 +70,17 @@ .TF "\fL-d\fI oldvacfile" .PD .TP +.BI -A +Use mtime for atimes in the archive. +By default, vac uses the real atime, which may just be noise. +.TP +.BI -N " name +Set the name of the archive (stored in the root block) to +.IR name . +If this option is not given, the name defaults to the name of +the vac file, or "cons" if writing to standard out. Names may +be up to 128 bytes long. +.TP .BI -b " blocksize Specifies the block size that data will be broken into. The units for the size can be specified by appending @@ -169,8 +180,6 @@ If listing files, print metadata in addition to the names. .SH SOURCE .B /sys/src/cmd/vac -.br -.B /sys/src/cmd/unvac .SH "SEE ALSO" .IR vacfs (4), .IR venti (8)