FIXES 17867
h_ID2Client currently returns a client struct with a shared lock. The
only caller of h_ID2Client (SRXAFS_FlushCPS) immediately calls
BoostSharedLock. This patch just goes ahead and makes h_ID2Client return
it with the write lock so we don't enter the Lock struct mutex multiple
times in a row. This also happens to remove the last reference to
BoostSharedLock in the tree.
for (i = 0; i < nids; i++, vd++) {
if (!*vd)
continue;
- client = h_ID2Client(*vd); /* returns client locked, or NULL */
+ client = h_ID2Client(*vd); /* returns client write locked, or NULL */
if (!client)
continue;
- BoostSharedLock(&client->lock);
client->prfail = 2; /* Means re-eval client's cps */
#ifdef notdef
if (client->tcon) {
/*MapName*/
-/* NOTE: this returns the client with a Shared lock */
+/* NOTE: this returns the client with a Write lock */
struct client *
h_ID2Client(afs_int32 vid)
{
if (!client->deleted && client->ViceId == vid) {
client->refCount++;
H_UNLOCK;
- ObtainSharedLock(&client->lock);
+ ObtainWriteLock(&client->lock);
H_LOCK;
client->refCount--;
H_UNLOCK;
}
H_UNLOCK;
- return 0;
+ return NULL;
}
/*