diff -Nru /n/sources/plan9/sys/src/cmd/fossil/9fsys.c /sys/src/cmd/fossil/9fsys.c --- /n/sources/plan9/sys/src/cmd/fossil/9fsys.c Thu Jun 16 19:58:17 2011 +++ /sys/src/cmd/fossil/9fsys.c Sat Dec 3 00:00:00 2011 @@ -1543,12 +1543,12 @@ { char *p, *host; Fsys *fsys; - int noauth, noventi, noperm, rflag, wstatallow, noatimeupd; + int noauth, noventi, noperm, rflag, wstatallow, noatimeupd, nomtimeupd; long ncache; char *usage = "usage: fsys name open [-APVWr] [-c ncache]"; ncache = 1000; - noauth = noperm = wstatallow = noventi = noatimeupd = 0; + noauth = noperm = wstatallow = noventi = noatimeupd = nomtimeupd = 0; rflag = OReadWrite; ARGBEGIN{ @@ -1569,6 +1569,9 @@ case 'a': noatimeupd = 1; break; + case 'm': + nomtimeupd = 1; + break; case 'c': p = ARGF(); if(p == nil) @@ -1629,6 +1632,7 @@ fsys->noperm = noperm; fsys->wstatallow = wstatallow; fsys->fs->noatimeupd = noatimeupd; + fsys->fs->nomtimeupd = nomtimeupd; qunlock(&fsys->lock); fsysPut(fsys); diff -Nru /n/sources/plan9/sys/src/cmd/fossil/dat.h /sys/src/cmd/fossil/dat.h --- /n/sources/plan9/sys/src/cmd/fossil/dat.h Thu May 19 18:40:10 2011 +++ /sys/src/cmd/fossil/dat.h Sat Dec 3 00:00:00 2011 @@ -75,6 +75,7 @@ Cache *cache; /* immutable */ int mode; /* immutable */ int noatimeupd; /* immutable */ + int nomtimeupd; /* immutable */ int blockSize; /* immutable */ VtSession *z; /* immutable */ Snap *snap; /* immutable */ diff -Nru /n/sources/plan9/sys/src/cmd/fossil/file.c /sys/src/cmd/fossil/file.c --- /n/sources/plan9/sys/src/cmd/fossil/file.c Thu Jun 16 00:00:00 2011 +++ /sys/src/cmd/fossil/file.c Sat Dec 3 19:42:27 2011 @@ -471,7 +471,7 @@ dir->mtime = time(0L); dir->mcount = 0; dir->ctime = dir->mtime; - dir->atime = dir->mtime; + dir->atime = 0L; dir->mode = mode; ff->boff = fileMetaAlloc(f, dir, 0); @@ -1685,7 +1685,7 @@ static void fileWAccess(File* f, char *mid) { - if(f->mode == OReadOnly) + if(f->mode == OReadOnly || f->fs->nomtimeupd) return; fileMetaLock(f); --- /n/sources/plan9/sys/man/8/fossilcons Thu Jun 30 16:30:12 2011 +++ /sys/man/8/fossilcons Sat Dec 3 00:00:00 2011 @@ -750,6 +750,9 @@ do not update file access times; primarily to avoid wear on flash memories .TP +.B -m +do not update file modification times +.TP .B -r open the file system read-only .TP