venti/copy: no rewriting unless rewrite flag is set (Nathaniel W Filardo)

This commit is contained in:
Russ Cox 2009-02-04 21:55:03 -08:00
parent ee85defda4
commit fd0a0b2a62

View file

@ -55,7 +55,8 @@ walk(uchar score[VtScoreSize], uint type, int base)
} }
walk(root.score, VtDirType, 0); walk(root.score, VtDirType, 0);
walk(root.prev, VtRootType, 0); walk(root.prev, VtRootType, 0);
vtrootpack(&root, buf); /* walk might have changed score */ if(rewrite)
vtrootpack(&root, buf); /* walk might have changed score */
break; break;
case VtDirType: case VtDirType:
@ -67,7 +68,8 @@ walk(uchar score[VtScoreSize], uint type, int base)
if(!(e.flags & VtEntryActive)) if(!(e.flags & VtEntryActive))
continue; continue;
walk(e.score, e.type, e.type&VtTypeBaseMask); walk(e.score, e.type, e.type&VtTypeBaseMask);
vtentrypack(&e, buf, i); if(rewrite)
vtentrypack(&e, buf, i);
} }
break; break;