diff options
author | Petter Rodhelind <petter.rodhelind@gmail.com> | 2020-01-14 11:41:08 +0100 |
---|---|---|
committer | Petter Rodhelind <petter.rodhelind@gmail.com> | 2020-01-14 11:41:08 +0100 |
commit | 02d7aa8915f9c3a3288dab01f321eb94ba219e3b (patch) | |
tree | f053238978479e408a2b83571443e132f30586ab /src/cmd/vac/pack.c | |
parent | c0c9d8f883dfd3a7f5a74499d91bb95884b15873 (diff) | |
parent | 3d1382b98a502d0c34d5ba2c462396acc515016e (diff) | |
download | plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.gz plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.tar.bz2 plan9port-02d7aa8915f9c3a3288dab01f321eb94ba219e3b.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/cmd/vac/pack.c')
-rw-r--r-- | src/cmd/vac/pack.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/cmd/vac/pack.c b/src/cmd/vac/pack.c index 5555cc0e..1eca665d 100644 --- a/src/cmd/vac/pack.c +++ b/src/cmd/vac/pack.c @@ -36,7 +36,7 @@ stringunpack(char **s, uchar **p, int *n) if(*n < 2) return -1; - + nn = U16GET(*p); *p += 2; *n -= 2; @@ -187,7 +187,7 @@ if(0)print("eo = %d en = %d\n", eo, en); } p = mb->buf + eo; - + /* make sure entry looks ok and includes an elem name */ if(en < 8 || U32GET(p) != DirMagic || en < 8 + U16GET(p+6)) { werrstr("corrupted meta block entry"); @@ -317,7 +317,7 @@ mbcompact(MetaBlock *mb, MetaChunk *mc) int oo, o, n, i; oo = MetaHeaderSize + mb->maxindex*MetaIndexSize; - + for(i=0; i<mb->nindex; i++) { o = mc[i].offset; n = mc[i].size; @@ -375,7 +375,7 @@ int vdsize(VacDir *dir, int version) { int n; - + if(version < 8 || version > 9) sysfatal("bad version %d in vdpack", version); @@ -433,7 +433,7 @@ vdpack(VacDir *dir, MetaEntry *me, int version) sysfatal("bad version %d in vdpack", version); p = me->p; - + U32PUT(p, DirMagic); U16PUT(p+4, version); /* version */ p += 6; @@ -442,7 +442,7 @@ vdpack(VacDir *dir, MetaEntry *me, int version) U32PUT(p, dir->entry); p += 4; - + if(version == 9){ U32PUT(p, dir->gen); U32PUT(p+4, dir->mentry); @@ -456,7 +456,7 @@ vdpack(VacDir *dir, MetaEntry *me, int version) p += stringpack(dir->uid, p); p += stringpack(dir->gid, p); p += stringpack(dir->mid, p); - + U32PUT(p, dir->mtime); U32PUT(p+4, dir->mcount); U32PUT(p+8, dir->ctime); @@ -481,7 +481,7 @@ vdpack(VacDir *dir, MetaEntry *me, int version) U64PUT(p+8, dir->qidmax, t32); p += 16; } - + if(dir->gen && version < 9) { U8PUT(p, DirGenEntry); U16PUT(p+1, 4); @@ -498,7 +498,7 @@ vdunpack(VacDir *dir, MetaEntry *me) { int t, nn, n, version; uchar *p; - + p = me->p; n = me->size; @@ -517,7 +517,7 @@ vdunpack(VacDir *dir, MetaEntry *me) if(version < 7 || version > 9) goto Err; p += 2; - n -= 2; + n -= 2; /* elem */ if(stringunpack(&dir->elem, &p, &n) < 0) @@ -560,7 +560,7 @@ vdunpack(VacDir *dir, MetaEntry *me) p += VtScoreSize; n -= VtScoreSize; } - + /* uid */ if(stringunpack(&dir->uid, &p, &n) < 0) goto Err; @@ -678,7 +678,7 @@ mbsearch(MetaBlock *mb, char *elem, int *ri, MetaEntry *me) *ri = i; return 1; } - + if(x < 0) b = i+1; else /* x > 0 */ @@ -686,7 +686,7 @@ mbsearch(MetaBlock *mb, char *elem, int *ri, MetaEntry *me) } assert(b == t); - + *ri = b; /* b is the index to insert this entry */ memset(me, 0, sizeof(*me)); |