solaris-obtain-locks-under-GLOCK-20020101

Fix the two places in Solaris afs_GetOnePage where locks
  are obtained/released without GLOCK.

====================
This delta was composed from multiple commits as part of the CVS->Git migration.
The checkin message with each commit was inconsistent.
The following are the additional commit messages.
====================

Fix the two places in Solaris afs_GetOnePage where locks
  are obtained/released without GLOCK.

(Fix error in application of patch)
This commit is contained in:
Nickolai Zeldovich 2002-01-10 06:42:21 +00:00 committed by Derrick Brashear
parent 7990f0d4b1
commit 259bf2a7d4

View File

@ -496,22 +496,20 @@ retry:
buf->b_blkno = btodb(toffset);
bp_mapin(buf); /* map it in to our address space */
/* afs_ustrategy will want to lock the dcache entry */
ReleaseReadLock(&tdc->lock);
#ifndef AFS_SUN5_ENV
ReleaseReadLock(&avc->lock);
#endif
#if defined(AFS_SUN5_ENV)
AFS_GLOCK();
/* afs_ustrategy will want to lock the dcache entry */
ReleaseReadLock(&tdc->lock);
code = afs_ustrategy(buf, acred); /* do the I/O */
ObtainReadLock(&tdc->lock);
AFS_GUNLOCK();
#else
ReleaseReadLock(&tdc->lock);
ReleaseReadLock(&avc->lock);
code = afs_ustrategy(buf); /* do the I/O */
#endif
#ifndef AFS_SUN5_ENV
ObtainReadLock(&avc->lock);
#endif
ObtainReadLock(&tdc->lock);
#endif
#ifdef AFS_SUN5_ENV
/* Before freeing unmap the buffer */