-/*
- * Copyright 2000, International Business Machines Corporation and others.
- * All Rights Reserved.
- *
- * This software has been released under the terms of the IBM Public
- * License. For details, see the LICENSE file in the top-level source
- * directory or online at http://www.openafs.org/dl/license10.html
- */
-/* AFSIFS portions copyright (c) 2005
- * the regents of the university of michigan
- * all rights reserved
- *
- * permission is granted to use, copy, create derivative works and
- * redistribute this software and such derivative works for any purpose,
- * so long as the name of the university of michigan is not used in
- * any advertising or publicity pertaining to the use or distribution
- * of this software without specific, written prior authorization. if
- * the above copyright notice or any other identification of the
- * university of michigan is included in any copy of any portion of
- * this software, then the disclaimer below must also be included.
- *
- * this software is provided as is, without representation from the
- * university of michigan as to its fitness for any purpose, and without
- * warranty by the university of michigan of any kind, either express
- * or implied, including without limitation the implied warranties of
- * merchantability and fitness for a particular purpose. the regents
- * of the university of michigan shall not be liable for any damages,
- * including special, indirect, incidental, or consequential damages,
- * with respect to any claim arising out or in connection with the use
- * of the software, even if it has been or is hereafter advised of the
- * possibility of such damages.
- */
-#include <afs/param.h>
#include <afs/stds.h>
#include <windows.h>
RpcShutdown();
+ cm_ReleaseAllLocks();
+
+ rx_Finalize();
+ afsi_log("rx finalization complete");
+
cm_ShutdownMappedMemory();
#ifdef REGISTER_POWER_NOTIFICATIONS
/* Called with scp->mx held */
long cm_UnlockByKey(cm_scache_t * scp,
- cm_key_t key,
- int flags,
- cm_user_t * userp,
- cm_req_t * reqp)
+ cm_key_t key,
+ int flags,
+ cm_user_t * userp,
+ cm_req_t * reqp)
{
long code = 0;
AFSFid tfid;
return (k1 == k2);
}
}
+
+void cm_ReleaseAllLocks(void)
+{
+ cm_scache_t *scp;
+ cm_req_t req;
+ cm_user_t *userp;
+ cm_key_t key;
+ cm_file_lock_t *fileLock;
+ int i;
+
+ for (i = 0; i < cm_data.hashTableSize; i++)
+ {
+ for ( scp = cm_data.hashTablep[i]; scp; scp = scp->nextp ) {
+ while (scp->fileLocksH != NULL) {
+ lock_ObtainMutex(&scp->mx);
+ lock_ObtainWrite(&cm_scacheLock);
+ if (!scp->fileLocksH) {
+ lock_ReleaseWrite(&cm_scacheLock);
+ lock_ReleaseMutex(&scp->mx);
+ break;
+ }
+ fileLock = (cm_file_lock_t *)((char *) scp->fileLocksH - offsetof(cm_file_lock_t, fileq));
+ userp = fileLock->userp;
+ cm_HoldUser(userp);
+ key = fileLock->key;
+ cm_HoldSCacheNoLock(scp);
+ lock_ReleaseWrite(&cm_scacheLock);
+ cm_UnlockByKey(scp, key, 0, userp, &req);
+ cm_ReleaseSCache(scp);
+ cm_ReleaseUser(userp);
+ lock_ReleaseMutex(&scp->mx);
+ }
+ }
+ }
+}