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

Neulinger, Nathan nneul@umr.edu
Fri, 20 Apr 2001 08:26:30 -0500


Just managed to answer my own question - it's purely for the 'break'. Seems
like just putting an 'else { }' would be easier.

-- Nathan

> -----Original Message-----
> From: Neulinger, Nathan [mailto:nneul@umr.edu]
> Sent: Thursday, April 19, 2001 4:14 PM
> To: 'openafs-devel@openafs.org'
> Subject: [OpenAFS-devel] question about code in afs_dcache.c
> 
> 
> 
>     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
> _______________________________________________
> OpenAFS-devel mailing list
> OpenAFS-devel@openafs.org
> https://lists.openafs.org/mailman/listinfo.cgi/openafs-devel
>