From a19728ba55f30a41799855b49c5cf6c07c840f87 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Fri, 13 Feb 2015 18:02:44 -0600 Subject: [PATCH] afs: Clarify vcache->mvid accesses Currently, numerous places in the code treat the 'mvid' field in struct vcache as a few different things: - If the vcache is a mountpoint, mvid points to the fid of the root dir of the target volume. - If the vcache is a volume root dir, mvid points to the fid of the parent dir for the mountpoint. - If the vcache is a sillyrenamed file, mvid points to a string, which is the name the vcache was renamed to. Despite these three things being very different (and one of them is a completely different type than the others), everywhere in the code just accesses mvid as 'avc->mvid'. This can make it very confusing as to what the field actually means at any particular part of the code, and makes it very difficult to search the code for places that use mvid in any one of these specific ways. So, to aid in code clarity, make mvid into a union, with the following members: - target_root: For the "mountpoint" case. - parent: For the "root dir" case. - silly_name: For the "sillyrename" case. This should have no effect on code behavior, but just makes the code a bit clearer. Change-Id: I45391bb7a99d6f8e35c44873b677d157ea681900 Reviewed-on: http://gerrit.openafs.org/11748 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk --- src/afs/DARWIN/osi_vnodeops.c | 2 +- src/afs/IRIX/osi_idbg.c | 4 +-- src/afs/LINUX/osi_export.c | 4 +-- src/afs/LINUX/osi_vnodeops.c | 6 ++-- src/afs/VNOPS/afs_vnop_dirops.c | 2 +- src/afs/VNOPS/afs_vnop_lookup.c | 54 ++++++++++++++++---------------- src/afs/VNOPS/afs_vnop_readdir.c | 14 ++++----- src/afs/VNOPS/afs_vnop_remove.c | 14 ++++----- src/afs/afs.h | 10 +++++- src/afs/afs_callback.c | 4 +-- src/afs/afs_vcache.c | 44 +++++++++++++------------- src/afs/afs_volume.c | 12 +++---- 12 files changed, 89 insertions(+), 81 deletions(-) diff --git a/src/afs/DARWIN/osi_vnodeops.c b/src/afs/DARWIN/osi_vnodeops.c index 4afb678cd..28c0e0a7f 100644 --- a/src/afs/DARWIN/osi_vnodeops.c +++ b/src/afs/DARWIN/osi_vnodeops.c @@ -1491,7 +1491,7 @@ afs_vop_rename(ap) /* unrewritten mount point? */ if (tvc->mvstat == AFS_MVSTAT_MTPT) { - if (tvc->mvid && (tvc->f.states & CMValid)) { + if (tvc->mvid.target_root && (tvc->f.states & CMValid)) { struct vrequest treq; afs_InitFakeStat(&fakestate); diff --git a/src/afs/IRIX/osi_idbg.c b/src/afs/IRIX/osi_idbg.c index 369405327..db7f64cdc 100644 --- a/src/afs/IRIX/osi_idbg.c +++ b/src/afs/IRIX/osi_idbg.c @@ -69,14 +69,14 @@ idbg_prafsnode(OSI_VC_DECL(avc)) #ifdef AFS_SGI64_ENV qprintf(" mapcnt %llu, mvstat %d anyAcc 0x%x Access 0x%x\n", avc->mapcnt, avc->mvstat, avc->f.anyAccess, avc->Access); - qprintf(" mvid 0x%x &lock 0x%x cred 0x%x\n", avc->mvid, &avc->lock, + qprintf(" mvid 0x%x &lock 0x%x cred 0x%x\n", avc->mvid.target_root, &avc->lock, avc->cred); qprintf(" rwlock 0x%x (%d) id %llu trips %d\n", &avc->vc_rwlock, valusema(&avc->vc_rwlock), avc->vc_rwlockid, avc->vc_locktrips); #else qprintf(" mapcnt %d mvstat %d anyAcc 0x%x Access 0x%x\n", avc->mapcnt, avc->mvstat, avc->f.anyAccess, avc->Access); - qprintf(" mvid 0x%x &lock 0x%x cred 0x%x\n", avc->mvid, &avc->lock, + qprintf(" mvid 0x%x &lock 0x%x cred 0x%x\n", avc->mvid.target_root, &avc->lock, avc->cred); qprintf(" rwlock 0x%x (%d) id %d trips %d\n", &avc->vc_rwlock, valusema(&avc->vc_rwlock), avc->vc_rwlockid, avc->vc_locktrips); diff --git a/src/afs/LINUX/osi_export.c b/src/afs/LINUX/osi_export.c index 15a3d9529..a3175b5d5 100644 --- a/src/afs/LINUX/osi_export.c +++ b/src/afs/LINUX/osi_export.c @@ -872,8 +872,8 @@ static struct dentry *afs_export_get_parent(struct dentry *child) } else if (vcp->mvstat == AFS_MVSTAT_ROOT) { /* volume root */ ObtainReadLock(&vcp->lock); - if (vcp->mvid && vcp->mvid->Fid.Volume) { - tfid = *vcp->mvid; + if (vcp->mvid.parent && vcp->mvid.parent->Fid.Volume) { + tfid = *vcp->mvid.parent; ReleaseReadLock(&vcp->lock); } else { ReleaseReadLock(&vcp->lock); diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 1655f244e..7bd909432 100644 --- a/src/afs/LINUX/osi_vnodeops.c +++ b/src/afs/LINUX/osi_vnodeops.c @@ -1175,7 +1175,7 @@ afs_linux_dentry_revalidate(struct dentry *dp, int flags) if (locked) { if (vcp->mvstat == AFS_MVSTAT_MTPT) { - if (vcp->mvid && (vcp->f.states & CMValid)) { + if (vcp->mvid.target_root && (vcp->f.states & CMValid)) { int tryEvalOnly = 0; int code = 0; struct vrequest *treq = NULL; @@ -1200,7 +1200,7 @@ afs_linux_dentry_revalidate(struct dentry *dp, int flags) } } } else if (vcp->mvstat == AFS_MVSTAT_ROOT && *dp->d_name.name != '/') { - osi_Assert(vcp->mvid != NULL); + osi_Assert(vcp->mvid.parent != NULL); } } @@ -1671,7 +1671,7 @@ afs_linux_sillyrename(struct inode *dir, struct dentry *dentry, VTOAFS(dir), (char *)__dp->d_name.name, credp); if (!code) { - tvc->mvid = (void *) __name; + tvc->mvid.silly_name = __name; crhold(credp); if (tvc->uncred) { crfree(tvc->uncred); diff --git a/src/afs/VNOPS/afs_vnop_dirops.c b/src/afs/VNOPS/afs_vnop_dirops.c index 8dea2036f..b664921a3 100644 --- a/src/afs/VNOPS/afs_vnop_dirops.c +++ b/src/afs/VNOPS/afs_vnop_dirops.c @@ -150,7 +150,7 @@ afs_mkdir(OSI_VC_DECL(adp), char *aname, struct vattr *attrs, /* Disconnected. */ /* We have the dir entry now, we can use it while disconnected. */ - if (adp->mvid == NULL) { + if (adp->mvid.target_root == NULL) { /* If not mount point, generate a new fid. */ newFid.Cell = adp->f.fid.Cell; newFid.Fid.Volume = adp->f.fid.Fid.Volume; diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c index 4692674e5..9d595646a 100644 --- a/src/afs/VNOPS/afs_vnop_lookup.c +++ b/src/afs/VNOPS/afs_vnop_lookup.c @@ -39,7 +39,7 @@ int afs_fakestat_enable = 0; /* 1: fakestat-all, 2: fakestat-crosscell */ * what "@sys" is in binary... */ #define AFS_EQ_ATSYS(name) (((name)[0]=='@')&&((name)[1]=='s')&&((name)[2]=='y')&&((name)[3]=='s')&&(!(name)[4])) -/* call under write lock, evaluate mvid field from a mt pt. +/* call under write lock, evaluate mvid.target_root field from a mt pt. * avc is the vnode of the mount point object; must be write-locked. * advc is the vnode of the containing directory (optional; if NULL and * EvalMountPoint succeeds, caller must initialize *avolpp->dotdot) @@ -279,7 +279,7 @@ EvalMountPoint(struct vcache *avc, struct vcache *advc, AFS_STATCNT(EvalMountPoint); #ifdef notdef - if (avc->mvid && (avc->f.states & CMValid)) + if (avc->mvid.target_root && (avc->f.states & CMValid)) return 0; /* done while racing */ #endif *avolpp = NULL; @@ -299,12 +299,12 @@ EvalMountPoint(struct vcache *avc, struct vcache *advc, if (!auniq) auniq = 1; - if (avc->mvid == 0) - avc->mvid = osi_AllocSmallSpace(sizeof(struct VenusFid)); - avc->mvid->Cell = (*avolpp)->cell; - avc->mvid->Fid.Volume = (*avolpp)->volume; - avc->mvid->Fid.Vnode = avnoid; - avc->mvid->Fid.Unique = auniq; + if (avc->mvid.target_root == NULL) + avc->mvid.target_root = osi_AllocSmallSpace(sizeof(struct VenusFid)); + avc->mvid.target_root->Cell = (*avolpp)->cell; + avc->mvid.target_root->Fid.Volume = (*avolpp)->volume; + avc->mvid.target_root->Fid.Vnode = avnoid; + avc->mvid.target_root->Fid.Unique = auniq; avc->f.states |= CMValid; /* Used to: if the mount point is stored within a backup volume, @@ -393,14 +393,14 @@ afs_EvalFakeStat_int(struct vcache **avcp, struct afs_fakestat_state *state, tvolp->dotdot.Fid.Unique = tvc->f.parent.unique; } } - if (tvc->mvid && (tvc->f.states & CMValid)) { + if (tvc->mvid.target_root && (tvc->f.states & CMValid)) { if (!canblock) { afs_int32 retry; do { retry = 0; ObtainWriteLock(&afs_xvcache, 597); - root_vp = afs_FindVCache(tvc->mvid, &retry, IS_WLOCK); + root_vp = afs_FindVCache(tvc->mvid.target_root, &retry, IS_WLOCK); if (root_vp && retry) { ReleaseWriteLock(&afs_xvcache); afs_PutVCache(root_vp); @@ -408,7 +408,7 @@ afs_EvalFakeStat_int(struct vcache **avcp, struct afs_fakestat_state *state, } while (root_vp && retry); ReleaseWriteLock(&afs_xvcache); } else { - root_vp = afs_GetVCache(tvc->mvid, areq, NULL, NULL); + root_vp = afs_GetVCache(tvc->mvid.target_root, areq, NULL, NULL); } if (!root_vp) { code = canblock ? ENOENT : 0; @@ -427,9 +427,9 @@ afs_EvalFakeStat_int(struct vcache **avcp, struct afs_fakestat_state *state, * NBObtainWriteLock to avoid potential deadlock. */ ObtainWriteLock(&root_vp->lock, 598); - if (!root_vp->mvid) - root_vp->mvid = osi_AllocSmallSpace(sizeof(struct VenusFid)); - *root_vp->mvid = tvolp->dotdot; + if (!root_vp->mvid.parent) + root_vp->mvid.parent = osi_AllocSmallSpace(sizeof(struct VenusFid)); + *root_vp->mvid.parent = tvolp->dotdot; ReleaseWriteLock(&root_vp->lock); } state->need_release = 1; @@ -1169,9 +1169,9 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp) /* now copy ".." entry back out of volume structure, if necessary */ if (tvcp->mvstat == AFS_MVSTAT_ROOT && (dotdot.Fid.Volume != 0)) { - if (!tvcp->mvid) - tvcp->mvid = osi_AllocSmallSpace(sizeof(struct VenusFid)); - *tvcp->mvid = dotdot; + if (!tvcp->mvid.parent) + tvcp->mvid.parent = osi_AllocSmallSpace(sizeof(struct VenusFid)); + *tvcp->mvid.parent = dotdot; } #ifdef AFS_DARWIN80_ENV @@ -1446,14 +1446,14 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr /* watch for ".." in a volume root */ if (adp->mvstat == AFS_MVSTAT_ROOT && aname[0] == '.' && aname[1] == '.' && !aname[2]) { /* looking up ".." in root via special hacks */ - if (adp->mvid == (struct VenusFid *)0 || adp->mvid->Fid.Volume == 0) { + if (adp->mvid.parent == (struct VenusFid *)0 || adp->mvid.parent->Fid.Volume == 0) { code = ENODEV; goto done; } /* otherwise we have the fid here, so we use it */ /*printf("Getting vcache\n");*/ - tvc = afs_GetVCache(adp->mvid, treq, NULL, NULL); - afs_Trace3(afs_iclSetp, CM_TRACE_GETVCDOTDOT, ICL_TYPE_FID, adp->mvid, + tvc = afs_GetVCache(adp->mvid.parent, treq, NULL, NULL); + afs_Trace3(afs_iclSetp, CM_TRACE_GETVCDOTDOT, ICL_TYPE_FID, adp->mvid.parent, ICL_TYPE_POINTER, tvc, ICL_TYPE_INT32, code); *avcp = tvc; code = (tvc ? 0 : ENOENT); @@ -1803,7 +1803,7 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr force_eval = 1; ReleaseReadLock(&tvc->lock); } - if (tvc->mvstat == AFS_MVSTAT_MTPT && (tvc->f.states & CMValid) && tvc->mvid != NULL) + if (tvc->mvstat == AFS_MVSTAT_MTPT && (tvc->f.states & CMValid) && tvc->mvid.target_root != NULL) force_eval = 1; /* This is now almost for free, get it correct */ #if defined(UKERNEL) @@ -1826,7 +1826,7 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr } /* next, we want to continue using the target of the mt point */ - if (tvc->mvid && (tvc->f.states & CMValid)) { + if (tvc->mvid.target_root && (tvc->f.states & CMValid)) { struct vcache *uvc; /* now lookup target, to set .. pointer */ afs_Trace2(afs_iclSetp, CM_TRACE_LOOKUP1, @@ -1837,9 +1837,9 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr if (tvolp && (tvolp->states & VForeign)) { /* XXXX tvolp has ref cnt on but not locked! XXX */ tvc = - afs_GetRootVCache(tvc->mvid, treq, NULL, tvolp); + afs_GetRootVCache(tvc->mvid.target_root, treq, NULL, tvolp); } else { - tvc = afs_GetVCache(tvc->mvid, treq, NULL, NULL); + tvc = afs_GetVCache(tvc->mvid.target_root, treq, NULL, NULL); } afs_PutVCache(uvc); /* we're done with it */ @@ -1856,12 +1856,12 @@ afs_lookup(OSI_VC_DECL(adp), char *aname, struct vcache **avcp, afs_ucred_t *acr * ptr to point back to the appropriate place */ if (tvolp) { ObtainWriteLock(&tvc->lock, 134); - if (tvc->mvid == NULL) { - tvc->mvid = + if (tvc->mvid.parent == NULL) { + tvc->mvid.parent = osi_AllocSmallSpace(sizeof(struct VenusFid)); } /* setup backpointer */ - *tvc->mvid = tvolp->dotdot; + *tvc->mvid.parent = tvolp->dotdot; ReleaseWriteLock(&tvc->lock); afs_PutVolume(tvolp, WRITE_LOCK); } diff --git a/src/afs/VNOPS/afs_vnop_readdir.c b/src/afs/VNOPS/afs_vnop_readdir.c index e05b50bf2..78929829f 100644 --- a/src/afs/VNOPS/afs_vnop_readdir.c +++ b/src/afs/VNOPS/afs_vnop_readdir.c @@ -340,16 +340,16 @@ afs_readdir_move(struct DirEntry *de, struct vcache *vc, struct uio *auio, } else if (vc->mvstat == AFS_MVSTAT_ROOT) { /* We are a volume root, which means our parent is in another * volume. Luckily, we should have his fid cached... */ - if (vc->mvid) { - if (!FidCmp(&afs_rootFid, vc->mvid)) { + if (vc->mvid.parent) { + if (!FidCmp(&afs_rootFid, vc->mvid.parent)) { /* Parent directory is the root of the AFS root */ Volume = 0; Vnode = 2; - } else if (vc->mvid->Fid.Vnode == 1 - && vc->mvid->Fid.Unique == 1) { + } else if (vc->mvid.parent->Fid.Vnode == 1 + && vc->mvid.parent->Fid.Unique == 1) { /* XXX The above test is evil and probably breaks DFS */ /* Parent directory is the target of a mount point */ - tvp = afs_GetVolume(vc->mvid, 0, READ_LOCK); + tvp = afs_GetVolume(vc->mvid.parent, 0, READ_LOCK); if (tvp) { Volume = tvp->mtpoint.Fid.Volume; Vnode = tvp->mtpoint.Fid.Vnode; @@ -357,8 +357,8 @@ afs_readdir_move(struct DirEntry *de, struct vcache *vc, struct uio *auio, } } else { /* Parent directory is not a volume root */ - Volume = vc->mvid->Fid.Volume; - Vnode = vc->mvid->Fid.Vnode; + Volume = vc->mvid.parent->Fid.Volume; + Vnode = vc->mvid.parent->Fid.Vnode; } } } else if (de->fid.vnode == 1 && de->fid.vunique == 1) { diff --git a/src/afs/VNOPS/afs_vnop_remove.c b/src/afs/VNOPS/afs_vnop_remove.c index f1bf408d2..b5f53b498 100644 --- a/src/afs/VNOPS/afs_vnop_remove.c +++ b/src/afs/VNOPS/afs_vnop_remove.c @@ -346,10 +346,10 @@ afs_remove(OSI_VC_DECL(adp), char *aname, afs_ucred_t *acred) code = afsrename(adp, aname, adp, unlname, acred, treq); Tnam1 = unlname; if (!code) { - struct VenusFid *oldmvid = NULL; - if (tvc->mvid) - oldmvid = tvc->mvid; - tvc->mvid = (struct VenusFid *)unlname; + void *oldmvid = NULL; + if (tvc->mvid.silly_name) + oldmvid = tvc->mvid.silly_name; + tvc->mvid.silly_name = unlname; if (oldmvid) osi_FreeSmallSpace(oldmvid); crhold(acred); @@ -410,7 +410,7 @@ afs_remunlink(struct vcache *avc, int doit) } #endif - if (avc->mvid && (doit || (avc->f.states & CUnlinkedDel))) { + if (avc->mvid.silly_name && (doit || (avc->f.states & CUnlinkedDel))) { struct vrequest *treq = NULL; if ((code = afs_CreateReq(&treq, avc->uncred))) { @@ -419,8 +419,8 @@ afs_remunlink(struct vcache *avc, int doit) /* Must bump the refCount because GetVCache may block. * Also clear mvid so no other thread comes here if we block. */ - unlname = (char *)avc->mvid; - avc->mvid = NULL; + unlname = avc->mvid.silly_name; + avc->mvid.silly_name = NULL; cred = avc->uncred; avc->uncred = NULL; diff --git a/src/afs/afs.h b/src/afs/afs.h index 4a6a13fb5..63fb03dd9 100644 --- a/src/afs/afs.h +++ b/src/afs/afs.h @@ -882,7 +882,15 @@ struct vcache { #endif #endif - struct VenusFid *mvid; /* Either parent dir (if root) or root (if mt pt) */ + union { + char *silly_name; /* For sillyrenamed regular files, the silly + * name the file was renamed to. */ + struct VenusFid *target_root; /* For mountpoints, the fid of the root dir + * in the target volume. */ + struct VenusFid *parent; /* For root dir vcaches, the fid of the + * parent dir. */ + } mvid; + char *linkData; /* Link data if a symlink. */ afs_hyper_t flushDV; /* data version last flushed from text */ afs_hyper_t mapDV; /* data version last flushed from map */ diff --git a/src/afs/afs_callback.c b/src/afs/afs_callback.c index 7e0e2dd87..c90f82f69 100644 --- a/src/afs/afs_callback.c +++ b/src/afs/afs_callback.c @@ -495,10 +495,10 @@ loop1: uq = QPrev(tq); AFS_FAST_RELE(tvc); } else if ((tvc->f.states & CMValid) - && (tvc->mvid->Fid.Volume == a_fid->Volume)) { + && (tvc->mvid.target_root->Fid.Volume == a_fid->Volume)) { tvc->f.states &= ~CMValid; if (!localFid.Cell) - localFid.Cell = tvc->mvid->Cell; + localFid.Cell = tvc->mvid.target_root->Cell; } } ReleaseReadLock(&afs_xvcache); diff --git a/src/afs/afs_vcache.c b/src/afs/afs_vcache.c index 0e7d13c6e..1d75f7c8e 100644 --- a/src/afs/afs_vcache.c +++ b/src/afs/afs_vcache.c @@ -204,9 +204,9 @@ afs_FlushVCache(struct vcache *avc, int *slept) } #endif - if (avc->mvid) - osi_FreeSmallSpace(avc->mvid); - avc->mvid = (struct VenusFid *)0; + if (avc->mvid.target_root) + osi_FreeSmallSpace(avc->mvid.target_root); + avc->mvid.target_root = NULL; if (avc->linkData) { afs_osi_Free(avc->linkData, strlen(avc->linkData) + 1); avc->linkData = NULL; @@ -838,7 +838,7 @@ afs_PrePopulateVCache(struct vcache *avc, struct VenusFid *afid, AFS_RWLOCK_INIT(&avc->lock, "vcache lock"); - avc->mvid = NULL; + memset(&avc->mvid, 0, sizeof(avc->mvid)); avc->linkData = NULL; avc->cbExpires = 0; avc->opens = 0; @@ -1822,10 +1822,10 @@ afs_GetVCache(struct VenusFid *afid, struct vrequest *areq, tvc->f.states |= CBackup; /* now copy ".." entry back out of volume structure, if necessary */ if (tvc->mvstat == AFS_MVSTAT_ROOT && tvp->dotdot.Fid.Volume != 0) { - if (!tvc->mvid) - tvc->mvid = (struct VenusFid *) + if (!tvc->mvid.parent) + tvc->mvid.parent = (struct VenusFid *) osi_AllocSmallSpace(sizeof(struct VenusFid)); - *tvc->mvid = tvp->dotdot; + *tvc->mvid.parent = tvp->dotdot; } afs_PutVolume(tvp, READ_LOCK); } @@ -2009,10 +2009,10 @@ afs_LookupVCache(struct VenusFid *afid, struct vrequest *areq, tvc->f.states |= CBackup; /* now copy ".." entry back out of volume structure, if necessary */ if (tvc->mvstat == AFS_MVSTAT_ROOT && tvp->dotdot.Fid.Volume != 0) { - if (!tvc->mvid) - tvc->mvid = (struct VenusFid *) + if (!tvc->mvid.parent) + tvc->mvid.parent = (struct VenusFid *) osi_AllocSmallSpace(sizeof(struct VenusFid)); - *tvc->mvid = tvp->dotdot; + *tvc->mvid.parent = tvp->dotdot; } } @@ -2234,10 +2234,10 @@ afs_GetRootVCache(struct VenusFid *afid, struct vrequest *areq, tvc->mvstat = AFS_MVSTAT_ROOT; } if (tvc->mvstat == AFS_MVSTAT_ROOT && tvolp->dotdot.Fid.Volume != 0) { - if (!tvc->mvid) - tvc->mvid = (struct VenusFid *) + if (!tvc->mvid.parent) + tvc->mvid.parent = (struct VenusFid *) osi_AllocSmallSpace(sizeof(struct VenusFid)); - *tvc->mvid = tvolp->dotdot; + *tvc->mvid.parent = tvolp->dotdot; } /* stat the file */ @@ -2544,10 +2544,10 @@ afs_StuffVcache(struct VenusFid *afid, * necessary */ if (tvc->mvstat == AFS_MVSTAT_ROOT && tvp->dotdot.Fid.Volume != 0) { - if (!tvc->mvid) - tvc->mvid = (struct VenusFid *) + if (!tvc->mvid.parent) + tvc->mvid.parent = (struct VenusFid *) osi_AllocSmallSpace(sizeof(struct VenusFid)); - *tvc->mvid = tvp->dotdot; + *tvc->mvid.parent = tvp->dotdot; } } /* store the stat on the file */ @@ -3083,9 +3083,9 @@ shutdown_vcache(void) for (tq = VLRU.prev; tq != &VLRU; tq = uq) { tvc = QTOV(tq); uq = QPrev(tq); - if (tvc->mvid) { - osi_FreeSmallSpace(tvc->mvid); - tvc->mvid = (struct VenusFid *)0; + if (tvc->mvid.target_root) { + osi_FreeSmallSpace(tvc->mvid.target_root); + tvc->mvid.target_root = NULL; } #ifdef AFS_AIX_ENV aix_gnode_rele(AFSTOV(tvc)); @@ -3100,9 +3100,9 @@ shutdown_vcache(void) */ for (i = 0; i < VCSIZE; i++) { for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { - if (tvc->mvid) { - osi_FreeSmallSpace(tvc->mvid); - tvc->mvid = (struct VenusFid *)0; + if (tvc->mvid.target_root) { + osi_FreeSmallSpace(tvc->mvid.target_root); + tvc->mvid.target_root = NULL; } #ifdef AFS_AIX_ENV if (tvc->v.v_gnode) diff --git a/src/afs/afs_volume.c b/src/afs/afs_volume.c index 1caaf03cb..2fd8a9ed2 100644 --- a/src/afs/afs_volume.c +++ b/src/afs/afs_volume.c @@ -476,14 +476,14 @@ loop: for (i = 0; i < VCSIZE; i++) { for (tvc = afs_vhashT[i]; tvc; tvc = tvc->hnext) { - /* if the volume of "mvid" of the vcache entry is among the - * ones we found earlier, then we re-evaluate it. Also, if the - * force bit is set or we explicitly asked to reevaluate the - * mt-pts, we clean the cmvalid bit */ + /* if the volume of "mvid.target_root" of the vcache entry is + * among the ones we found earlier, then we re-evaluate it. + * Also, if the force bit is set or we explicitly asked to + * reevaluate the mt-pts, we clean the cmvalid bit */ if ((flags & (AFS_VOLCHECK_FORCE | AFS_VOLCHECK_MTPTS)) - || (tvc->mvid - && inVolList(tvc->mvid, nvols, volumeID, cellID))) + || (tvc->mvid.target_root + && inVolList(tvc->mvid.target_root, nvols, volumeID, cellID))) tvc->f.states &= ~CMValid; /* If the volume that this file belongs to was reset earlier, -- 2.39.5