[OpenAFS-devel] question about code in afs_dcache.c

Neulinger, Nathan nneul@umr.edu
Thu, 19 Apr 2001 16:14:14 -0500


    if (afs_discardDCList == NULLIDX && afs_freeDCList == NULLIDX) {
        while (1) {
        if (!setLocks) avc->states |= CDCLock;
        afs_GetDownD(5, (int*)0);   /* just need slots */
        if (!setLocks) avc->states &= (~CDCLock);
        if (afs_discardDCList != NULLIDX || afs_freeDCList != NULLIDX)
            break;
        /* If we can't get space for 5 mins we give up and panic */
        if (++downDCount > 300)
            osi_Panic("getdcache");
        MReleaseWriteLock(&afs_xdcache);
        afs_osi_Wait(1000, 0, 0);
        goto RetryLookup;
        }


why the while loop? I can't see any way the code would ever get to repeat
the loop? (Solaris cc complains about end-of-loop code not being reachable
as well.)

-- Nathan

------------------------------------------------------------
Nathan Neulinger                       EMail:  nneul@umr.edu
University of Missouri - Rolla         Phone: (573) 341-4841
Computing Services                       Fax: (573) 341-4216