return 0;
}
+static void
+FlushAllVCBs(struct rx_connection **rxconns, int nconns, int nservers,
+ struct afs_conn **conns, struct srvAddr **addrs)
+{
+ afs_int32 *results;
+ afs_int32 i;
+
+ results = afs_osi_Alloc(nservers * sizeof (afs_int32));
+ osi_Assert(results != NULL);
+
+ AFS_GUNLOCK();
+ multi_Rx(rxconns,nconns)
+ {
+ multi_RXAFS_GiveUpAllCallBacks();
+ results[multi_i] = multi_error;
+ } multi_End;
+ AFS_GLOCK();
+
+ /*
+ * Freeing the CBR will unlink it from the server's CBR list
+ * do it here, not in the loop, because a dynamic CBR will call
+ * into the memory management routines.
+ */
+ for ( i = 0 ; i < nconns ; i++ ) {
+ if (results[i] == 0) {
+ /* Unchain all of them */
+ while (addrs[i]->server->cbrs)
+ afs_FreeCBR(addrs[i]->server->cbrs);
+ }
+ }
+ afs_osi_Free(results, nservers * sizeof(afs_int32));
+}
+
/*!
* Flush all queued callbacks to all servers.
*
struct afs_conn *tc;
int safety1, safety2, safety3;
XSTATS_DECLS;
+
+ if (AFS_IS_DISCONNECTED)
+ return ENETDOWN;
+
if ((code = afs_InitReq(&treq, afs_osi_credp)))
return code;
treq.flags |= O_NONBLOCK;
if (lockit)
ObtainWriteLock(&afs_xvcb, 273);
+ /*
+ * Shutting down.
+ * First, attempt a multi across everything, all addresses
+ * for all servers we know of.
+ */
+
+ if (lockit == 2)
+ afs_LoopServers(2, NULL, 0, FlushAllVCBs, NULL);
+
ObtainReadLock(&afs_xserver);
for (i = 0; i < NSERVERS; i++) {
for (safety1 = 0, tsp = afs_servers[i];
ReleaseWriteLock(&afs_xvcache);
- afs_FlushVCBs(1);
+ afs_FlushVCBs(2);
}
/*!