shutdown_bufferpackage();
shutdown_cache();
shutdown_osi();
+ /*
+ * Close file only after daemons which can write to it are stopped.
+ * Need to close before the osinet shutdown to avoid failing check
+ * for dangling memory allocations.
+ */
+ if (afs_cacheInodep) { /* memcache won't set this */
+ osi_UFSClose(afs_cacheInodep); /* Since we always leave it open */
+ afs_cacheInodep = 0;
+ }
+ /*
+ * Shutdown the ICL logs - needed to free allocated memory space and avoid
+ * warnings from shutdown_osinet
+ */
+ shutdown_icl();
shutdown_osinet();
shutdown_osifile();
shutdown_vnodeops();
*/
afs_warn(" ALL allocated tables\n");
- /* Close file only after daemons which can write to it are stopped. */
- if (afs_cacheInodep) { /* memcache won't set this */
- osi_UFSClose(afs_cacheInodep); /* Since we always leave it open */
- afs_cacheInodep = 0;
- }
-
afs_shuttingdown = 0;
return; /* Just kill daemons for now */
return 0;
}
+/* Function called at shutdown - zap everything */
+int
+shutdown_icl(void)
+{
+ struct afs_icl_log *logp;
+ struct afs_icl_set *setp;
+
+ setp = afs_icl_FindSet("cm");
+ if (setp) {
+ /* Release the reference from Find, and the initial one */
+ afs_icl_SetFree(setp);
+ afs_icl_SetFree(setp);
+ }
+ setp = afs_icl_FindSet("cmlongterm");
+ if (setp) {
+ /* Release the reference from Find, and the initial one */
+ afs_icl_SetFree(setp);
+ afs_icl_SetFree(setp);
+ }
+ logp = afs_icl_FindLog("cmfx");
+ if (logp) {
+ /* Release the reference from Find, and the initial one */
+ afs_icl_LogFree(logp);
+ afs_icl_LogFree(logp);
+ }
+ return 0;
+}
+
int
afs_icl_InitLogs(void)
{
if (flags & ICL_CRSET_FLAG_PERSISTENT)
states |= ICL_SETF_PERSISTENT;
- setp = (struct afs_icl_set *)afs_osi_Alloc(sizeof(struct afs_icl_set));
+ setp = (struct afs_icl_set *)osi_AllocSmallSpace(sizeof(struct afs_icl_set));
memset((caddr_t) setp, 0, sizeof(*setp));
setp->refCount = 1;
if (states & ICL_SETF_FREED)
/* afs_icl.c */
extern struct afs_icl_set *afs_icl_allSets;
extern int afs_icl_InitLogs(void);
+extern int shutdown_icl(void);
extern int afs_icl_CreateLog(char *name, afs_int32 logSize,
struct afs_icl_log **outLogpp);
extern int afs_icl_CreateLogWithFlags(char *name, afs_int32 logSize,