From 1cf667e0df61651538bef9b7b89f1ec98acfe6c3 Mon Sep 17 00:00:00 2001 From: Andrew Deason Date: Thu, 29 Sep 2011 12:04:07 -0500 Subject: [PATCH] afs: Remove afs1_readdir The function afs1_readdir is not referenced anywhere. Remove it, as it currently causes compilation errors (a typo with the origOffset/orginOffset variable name). This is a 1.6-only change. afs1_readdir was removed on master as a part of commit 0284e65f97861e888d95576f22a93cd681813c39. Change-Id: I7bd3f73867abb53df0cd2a96180b7cd5f19de3e6 Reviewed-on: http://gerrit.openafs.org/5522 Tested-by: BuildBot Reviewed-by: Derrick Brashear --- src/afs/VNOPS/afs_vnop_readdir.c | 233 ------------------------------- 1 file changed, 233 deletions(-) diff --git a/src/afs/VNOPS/afs_vnop_readdir.c b/src/afs/VNOPS/afs_vnop_readdir.c index d123dcbd0..f3dc39bde 100644 --- a/src/afs/VNOPS/afs_vnop_readdir.c +++ b/src/afs/VNOPS/afs_vnop_readdir.c @@ -926,237 +926,4 @@ afs_readdir(OSI_VC_DECL(avc), struct uio *auio, afs_ucred_t *acred) return code; } -#if defined(AFS_HPUX_ENV) -int -afs1_readdir(struct vcache *avc, struct uio *auio, afs_ucred_t *acred) -{ - struct vrequest treq; - struct dcache *tdc; - afs_size_t origOffset, len; - int code = 0; - struct DirEntry *ode = 0, *nde = 0; - int o_slen = 0, n_slen = 0; - afs_uint32 us; - /* - * XXX All the hacks for alloced sdirEntry and inlining of - * afs_readdir_move instead of calling it is necessary for hpux due to - * stack problems that seem to occur when coming thru the nfs - * translator side XXX - */ - struct minnfs_direct *sdirEntry = (struct minnfs_direct *) - osi_AllocSmallSpace(sizeof(struct min_direct)); - afs_int32 rlen; - - struct afs_fakestat_state fakestate; - - AFS_STATCNT(afs_readdir); - if (code = afs_InitReq(&treq, acred)) { - osi_FreeSmallSpace((char *)sdirEntry); - return code; - } - afs_InitFakeStat(&fakestate); - AFS_DISCON_LOCK(); - code = afs_EvalFakeStat(&avc, &fakestate, &treq); - if (code) { - osi_FreeSmallSpace((char *)sdirEntry); - AFS_DISCON_UNLOCK(); - afs_PutFakeStat(&fakestate); - return code; - } - /* update the cache entry */ - tagain: - 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, &len, 1); - if (!tdc) { - code = ENOENT; - goto done; - } - ObtainReadLock(&avc->lock); - ObtainReadLock(&tdc->lock); - - /* - * Make sure that the data in the cache is current. There are two - * cases we need to worry about: - * 1. The cache data is being fetched by another process. - * 2. The cache data is no longer valid - */ - while ((avc->f.states & CStatd) - && (tdc->dflags & DFFetching) - && hsame(avc->f.m.DataVersion, tdc->f.versionNo)) { - afs_Trace4(afs_iclSetp, CM_TRACE_DCACHEWAIT, ICL_TYPE_STRING, - __FILE__, ICL_TYPE_INT32, __LINE__, ICL_TYPE_POINTER, tdc, - ICL_TYPE_INT32, tdc->dflags); - ReleaseReadLock(&tdc->lock); - ReleaseReadLock(&avc->lock); - afs_osi_Sleep(&tdc->validPos); - ObtainReadLock(&avc->lock); - ObtainReadLock(&tdc->lock); - } - if (!(avc->f.states & CStatd) - || !hsame(avc->f.m.DataVersion, tdc->f.versionNo)) { - ReleaseReadLock(&tdc->lock); - ReleaseReadLock(&avc->lock); - afs_PutDCache(tdc); - goto tagain; - } - - len = 0; - auio->uio_fpflags = 0; - while (code == 0) { - origOffset = AFS_UIO_OFFSET(auio); - - /* scan for the next interesting entry scan for in-use blob - * otherwise up point at this blob note that ode, if non-zero, - * also represents a held dir page */ - us = BlobScan(tdc, (orginOffset >> 5)); - - if (us) - afs_dir_GetVerifiedBlob(tdc, us, &nde); - - if (us == 0 || nde == NULL) { - /* failed to setup nde, return what we've got, and release ode */ - if (len) { - /* something to hand over. */ - sdirEntry->d_fileno = - (avc->f.fid.Fid.Volume << 16) + ntohl(ode->fid.vnode); - FIXUPSTUPIDINODE(sdirEntry->d_fileno); - sdirEntry->d_reclen = rlen = AFS_UIO_RESID(auio); - sdirEntry->d_namlen = o_slen; - sdirEntry->d_off = origOffset; - AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, - auio, code); - if (code == 0) { - AFS_UIOMOVE(ode->name, o_slen, UIO_READ, auio, code); - } - /* pad out the remaining characters with zeros */ - if (code == 0) { - AFS_UIOMOVE(bufofzeros, - ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, - UIO_READ, auio, code); - } - /* pad out the difference between rlen and slen... */ - if (NDIRSIZ_LEN(o_slen) < rlen) { - while (NDIRSIZ_LEN(o_slen) < rlen) { - int minLen = rlen - NDIRSIZ_LEN(o_slen); - if (minLen > sizeof(bufofzeros)) - minLen = sizeof(bufofzeros); - AFS_UIOMOVE(bufofzeros, minLen, UIO_READ, auio, code); - rlen -= minLen; - } - } - AFS_UIO_SETRESID(auio, 0); - } else { - /* nothin to hand over */ - } - if (ode) - DRelease(ode, 0); - goto dirend; - } - /* by here nde is set */ - - /* Do we have enough user space to carry out our mission? */ - n_slen = strlen(nde->name); - if (NDIRSIZ_LEN(n_slen) >= (AFS_UIO_RESID(auio) - len)) { - /* No can do no more now; ya know... at this time */ - DRelease(nde, 0); /* can't use this one. */ - if (len) { - sdirEntry->d_fileno = - (avc->f.fid.Fid.Volume << 16) + ntohl(ode->fid.vnode); - FIXUPSTUPIDINODE(sdirEntry->d_fileno); - sdirEntry->d_reclen = rlen = AFS_UIO_RESID(auio); - sdirEntry->d_namlen = o_slen; - sdirEntry->d_off = origOffset; - AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, - auio, code); - if (code == 0) - AFS_UIOMOVE(ode->name, o_slen, UIO_READ, auio, code); - /* pad out the remaining characters with zeros */ - if (code == 0) { - AFS_UIOMOVE(bufofzeros, - ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, - UIO_READ, auio, code); - } - /* pad out the difference between rlen and slen... */ - if (NDIRSIZ_LEN(o_slen) < rlen) { - while (NDIRSIZ_LEN(o_slen) < rlen) { - int minLen = rlen - NDIRSIZ_LEN(o_slen); - if (minLen > sizeof(bufofzeros)) - minLen = sizeof(bufofzeros); - AFS_UIOMOVE(bufofzeros, minLen, UIO_READ, auio, code); - rlen -= minLen; - } - } - /* this next line used to be AFSVFS40 or AIX 3.1, but is really generic */ - AFS_UIO_SETOFFSET(auio, origOffset); - AFS_UIO_SETRESID(auio, 0); - } else { /* trouble, can't give anything to the user! */ - /* even though he has given us a buffer, - * even though we have something to give us, - * Looks like we lost something somewhere. - */ - code = EINVAL; - } - if (ode) - DRelease(ode, 0); - goto dirend; - } - - /* - * In any event, we move out the LAST de entry, getting ready - * to set up for the next one. - */ - if (len) { - sdirEntry->d_fileno = - (avc->f.fid.Fid.Volume << 16) + ntohl(ode->fid.vnode); - FIXUPSTUPIDINODE(sdirEntry->d_fileno); - sdirEntry->d_reclen = rlen = len; - sdirEntry->d_namlen = o_slen; - sdirEntry->d_off = origOffset; - AFS_UIOMOVE((char *)sdirEntry, sizeof(*sdirEntry), UIO_READ, auio, - code); - if (code == 0) - AFS_UIOMOVE(ode->name, o_slen, UIO_READ, auio, code); - /* pad out the remaining characters with zeros */ - if (code == 0) { - AFS_UIOMOVE(bufofzeros, - ((o_slen + 1 + DIRPAD) & ~DIRPAD) - o_slen, - UIO_READ, auio, code); - } - /* pad out the difference between rlen and slen... */ - if (NDIRSIZ_LEN(o_slen) < rlen) { - while (NDIRSIZ_LEN(o_slen) < rlen) { - int minLen = rlen - NDIRSIZ_LEN(o_slen); - if (minLen > sizeof(bufofzeros)) - minLen = sizeof(bufofzeros); - AFS_UIOMOVE(bufofzeros, minLen, UIO_READ, auio, code); - rlen -= minLen; - } - } - } - len = NDIRSIZ_LEN(o_slen = n_slen); - if (ode) - DRelease(ode, 0); - ode = nde; - AFS_UIO_OFFSET(auio) = ((us + afs_dir_NameBlobs(nde->name)) << 5); - } - if (ode) - DRelease(ode, 0); - - dirend: - ReleaseReadLock(&tdc->lock); - afs_PutDCache(tdc); - ReleaseReadLock(&avc->lock); - - done: - osi_FreeSmallSpace((char *)sdirEntry); - AFS_DISCON_UNLOCK(); - afs_PutFakeStat(&fakestate); - code = afs_CheckCode(code, &treq, 29); - return code; -} - -#endif #endif /* !AFS_LINUX20_ENV */ -- 2.39.5