ObtainReadLock(&afs_xvcache);
if ((tvc = afs_FindVCache(&tfid, 0, 0))) {
ReleaseReadLock(&afs_xvcache);
- if (tvc->mvstat) {
+ if (tvc->mvstat != AFS_MVSTAT_FILE) {
afs_PutVCache(tvc);
return DT_DIR;
} else if (((tvc->f.states) & (CStatd | CTruth))) {
else if (vtype == VREG)
return DT_REG;
/* Don't do this until we're sure it can't be a mtpt */
- /* if we're CStatd and CTruth and mvstat==0, it's a link */
+ /* if we're CStatd and CTruth and mvstat==AFS_MVSTAT_FILE, it's a link */
else if (vtype == VLNK)
return DT_LNK;
/* what other types does AFS support? */
if (!FidCmp(&afs_rootFid, &vc->f.fid)) {
Volume = 0;
Vnode = 2;
- } else if (vc->mvstat == 2) {
+ } else if (vc->mvstat == AFS_MVSTAT_ROOT) {
tvp = afs_GetVolume(&vc->f.fid, 0, READ_LOCK);
if (tvp) {
Volume = tvp->mtpoint.Fid.Volume;
/* We are the root of the AFS root, and thus our own parent */
Volume = 0;
Vnode = 2;
- } else if (vc->mvstat == 2) {
+ } 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;
}
} 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) {
}
#else /* AFS_SGI53_ENV */
#if defined(AFS_SUN5_ENV) || (defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL))
-#if defined(AFS_SUN5_ENV)
- direntp = (struct dirent64 *)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
-#else
- direntp = (struct dirent *)osi_AllocLargeSpace(AFS_LRALLOCSIZ);
-#endif
+ direntp = osi_AllocLargeSpace(AFS_LRALLOCSIZ);
direntp->d_ino = afs_calc_inum(vc->f.fid.Cell, Volume, ntohl(Vnode));
#if defined(AFS_AIX51_ENV) && defined(AFS_64BIT_KERNEL)
direntp->d_offset = off;
#endif
#endif
{
- struct vrequest treq;
+ struct vrequest *treq = NULL;
struct dcache *tdc;
afs_size_t origOffset, tlen;
afs_int32 len;
* it is necessary for hpux due to stack problems that seem to occur when coming thru the nfs
* translator side XXX
*/
- struct min_direct *sdirEntry =
- (struct min_direct *)osi_AllocSmallSpace(sizeof(struct min_direct));
+ struct min_direct *sdirEntry = osi_AllocSmallSpace(sizeof(struct min_direct));
afs_int32 rlen;
#endif
return EFBIG;
#endif
- if ((code = afs_InitReq(&treq, acred))) {
+ if ((code = afs_CreateReq(&treq, acred))) {
#ifdef AFS_HPUX_ENV
osi_FreeSmallSpace((char *)sdirEntry);
#endif
AFS_DISCON_LOCK();
- code = afs_EvalFakeStat(&avc, &fakestate, &treq);
+ code = afs_EvalFakeStat(&avc, &fakestate, treq);
if (code)
goto done;
tagain:
- code = afs_VerifyVCache(avc, &treq);
+ code = afs_VerifyVCache(avc, treq);
if (code)
goto done;
/* get a reference to the entire directory */
- tdc = afs_GetDCache(avc, (afs_size_t) 0, &treq, &origOffset, &tlen, 1);
- len = tlen;
+ tdc = afs_GetDCache(avc, (afs_size_t) 0, treq, &origOffset, &tlen, 1);
if (!tdc) {
code = ENOENT;
goto done;
#endif /* AFS_SGI53_ENV */
DRelease(&oldEntry, 0);
+ oldEntry = nextEntry;
ode = nde;
AFS_UIO_SETOFFSET(auio, (afs_int32) ((us + afs_dir_NameBlobs(nde->name)) << 5));
}
#endif
AFS_DISCON_UNLOCK();
afs_PutFakeStat(&fakestate);
- code = afs_CheckCode(code, &treq, 28);
+ code = afs_CheckCode(code, treq, 28);
+ afs_DestroyReq(treq);
return code;
}