aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/vac
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2008-06-15 01:46:23 -0400
committerRuss Cox <rsc@swtch.com>2008-06-15 01:46:23 -0400
commitfa3c8da1c01edc6559fa6ea71fdfb402cd9914b4 (patch)
treeae0eb53dc180f74b30e83f30db996bc4050a3752 /src/cmd/vac
parent4395d738f4f5a3a477e2a3a24b927e8a24ef4cc0 (diff)
downloadplan9port-fa3c8da1c01edc6559fa6ea71fdfb402cd9914b4.tar.gz
plan9port-fa3c8da1c01edc6559fa6ea71fdfb402cd9914b4.tar.bz2
plan9port-fa3c8da1c01edc6559fa6ea71fdfb402cd9914b4.zip
vacfs: present qids correctly
Diffstat (limited to 'src/cmd/vac')
-rw-r--r--src/cmd/vac/file.c8
-rw-r--r--src/cmd/vac/vac.c4
-rw-r--r--src/cmd/vac/vac.h1
-rw-r--r--src/cmd/vac/vacfs.c9
4 files changed, 15 insertions, 7 deletions
diff --git a/src/cmd/vac/file.c b/src/cmd/vac/file.c
index fac419b1..9ae5530e 100644
--- a/src/cmd/vac/file.c
+++ b/src/cmd/vac/file.c
@@ -142,9 +142,16 @@ uvlong
vacfilegetid(VacFile *f)
{
/* immutable */
+fprint(2, "getid %s %lld+%lld = %lld\n", f->dir.elem, f->qidoffset, f->dir.qid, f->qidoffset+f->dir.qid);
return f->qidoffset + f->dir.qid;
}
+uvlong
+vacfilegetqidoffset(VacFile *f)
+{
+ return f->qidoffset;
+}
+
ulong
vacfilegetmcount(VacFile *f)
{
@@ -402,6 +409,7 @@ dirlookup(VacFile *f, char *elem)
filefree(ff);
goto Err;
}
+fprint(2, "offset %s %lld\n", ff->dir.elem, ff->dir.qidoffset);
ff->qidoffset = f->qidoffset + ff->dir.qidoffset;
vtfileunlock(meta);
vtblockput(b);
diff --git a/src/cmd/vac/vac.c b/src/cmd/vac/vac.c
index 6716aa1d..e97951b8 100644
--- a/src/cmd/vac/vac.c
+++ b/src/cmd/vac/vac.c
@@ -586,7 +586,9 @@ vacmergefile(VacFile *fp, VacFile *mp, VacDir *d, char *vacfile,
d->qidoffset = offset;
d->qidmax = max;
}
- if(vacfilesetdir(f, d) < 0 || vacfilesetentries(f, &ed, &em) < 0){
+ if(vacfilesetdir(f, d) < 0
+ || vacfilesetentries(f, &ed, &em) < 0
+ || vacfilesetqidspace(f, d->qidoffset, d->qidmax) < 0){
warn("vacmergefile %s: %r", d->elem);
vacfiledecref(mf);
vacfiledecref(f);
diff --git a/src/cmd/vac/vac.h b/src/cmd/vac/vac.h
index 610028f4..0b82d0eb 100644
--- a/src/cmd/vac/vac.h
+++ b/src/cmd/vac/vac.h
@@ -135,6 +135,7 @@ int vacfilesetentries(VacFile *f, VtEntry *e, VtEntry *me);
void vdcleanup(VacDir *dir);
void vdcopy(VacDir *dst, VacDir *src);
int vacfilesetqidspace(VacFile*, u64int, u64int);
+uvlong vacfilegetqidoffset(VacFile*);
VacDirEnum *vdeopen(VacFile*);
int vderead(VacDirEnum*, VacDir *);
diff --git a/src/cmd/vac/vacfs.c b/src/cmd/vac/vacfs.c
index 5ec17aec..5c65cf3b 100644
--- a/src/cmd/vac/vacfs.c
+++ b/src/cmd/vac/vacfs.c
@@ -637,14 +637,11 @@ vacstat(VacFile *parent, VacDir *vd, uchar *p, int np)
char *ext = nil;
#endif
- USED(parent);
-
memset(&dir, 0, sizeof(dir));
- /*
- * Where do path and version come from
- */
- dir.qid.path = vd->qid;
+ dir.qid.path = vd->qid + vacfilegetqidoffset(parent);
+ if(vd->qidspace)
+ dir.qid.path += vd->qidoffset;
dir.qid.vers = vd->mcount;
dir.mode = vd->mode & 0777;
if(vd->mode & ModeAppend){