From eecd963f6582e373be75415644adbfc8ba0f7928 Mon Sep 17 00:00:00 2001 From: Derrick Brashear Date: Thu, 13 Dec 2007 19:18:29 +0000 Subject: [PATCH] DEVEL15-shutdown-cleanup-20071213 LICENSE IPL10 get rid of cold_shutdown; it's in afs_prototypes.h. log when we don't clean up memory (cherry picked from commit b33fb96fff39c421064d03ff058dde76f2aeed8b) --- src/afs/AIX/osi_file.c | 2 -- src/afs/AIX/osi_vfsops.c | 2 -- src/afs/DARWIN/osi_file.c | 2 -- src/afs/DUX/osi_file.c | 2 -- src/afs/FBSD/osi_file.c | 2 -- src/afs/HPUX/osi_file.c | 2 -- src/afs/IRIX/osi_file.c | 2 -- src/afs/IRIX/osi_vfsops.c | 1 - src/afs/LINUX/osi_file.c | 2 -- src/afs/NBSD/osi_file.c | 2 -- src/afs/SOLARIS/osi_file.c | 2 -- src/afs/afs_buffer.c | 1 - src/afs/afs_osi_alloc.c | 13 +++++++++---- 13 files changed, 9 insertions(+), 26 deletions(-) diff --git a/src/afs/AIX/osi_file.c b/src/afs/AIX/osi_file.c index 97e29583e8..7f5e60c682 100644 --- a/src/afs/AIX/osi_file.c +++ b/src/afs/AIX/osi_file.c @@ -272,8 +272,6 @@ afs_osi_MapStrategy(int (*aproc) (), register struct buf *bp) void shutdown_osifile(void) { - extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osifile); if (afs_cold_shutdown) { afs_osicred_initialized = 0; diff --git a/src/afs/AIX/osi_vfsops.c b/src/afs/AIX/osi_vfsops.c index ad058f7519..9c51c67238 100644 --- a/src/afs/AIX/osi_vfsops.c +++ b/src/afs/AIX/osi_vfsops.c @@ -34,8 +34,6 @@ extern struct afs_exporter *afs_nfsexporter; struct vfs *afs_globalVFS = 0; struct vcache *afs_globalVp = 0; -extern int afs_cold_shutdown; - static int afs_root_nolock(struct vfs *afsp, struct vnode **avpp); static int diff --git a/src/afs/DARWIN/osi_file.c b/src/afs/DARWIN/osi_file.c index eddbb5c479..d0f2f197e9 100644 --- a/src/afs/DARWIN/osi_file.c +++ b/src/afs/DARWIN/osi_file.c @@ -418,8 +418,6 @@ afs_osi_Write(register struct osi_file *afile, afs_int32 offset, void *aptr, void shutdown_osifile(void) { - extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osifile); if (afs_cold_shutdown) { afs_osicred_initialized = 0; diff --git a/src/afs/DUX/osi_file.c b/src/afs/DUX/osi_file.c index 450312ec10..87a34cc58e 100644 --- a/src/afs/DUX/osi_file.c +++ b/src/afs/DUX/osi_file.c @@ -279,8 +279,6 @@ afs_osi_MapStrategy(int (*aproc) (), register struct buf *bp) void shutdown_osifile(void) { - extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osifile); if (afs_cold_shutdown) { afs_osicred_initialized = 0; diff --git a/src/afs/FBSD/osi_file.c b/src/afs/FBSD/osi_file.c index 932e864613..c7d7598093 100644 --- a/src/afs/FBSD/osi_file.c +++ b/src/afs/FBSD/osi_file.c @@ -244,8 +244,6 @@ afs_osi_MapStrategy(int (*aproc) (), register struct buf *bp) void shutdown_osifile(void) { - extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osifile); if (afs_cold_shutdown) { afs_osicred_initialized = 0; diff --git a/src/afs/HPUX/osi_file.c b/src/afs/HPUX/osi_file.c index 6b269b2209..96365ab648 100644 --- a/src/afs/HPUX/osi_file.c +++ b/src/afs/HPUX/osi_file.c @@ -223,8 +223,6 @@ afs_osi_Write(register struct osi_file *afile, afs_int32 offset, void *aptr, void shutdown_osifile(void) { - extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osifile); if (afs_cold_shutdown) { afs_osicred_initialized = 0; diff --git a/src/afs/IRIX/osi_file.c b/src/afs/IRIX/osi_file.c index 0a91f9702b..988864cfd3 100644 --- a/src/afs/IRIX/osi_file.c +++ b/src/afs/IRIX/osi_file.c @@ -262,8 +262,6 @@ afs_osi_MapStrategy(int (*aproc) (), register struct buf *bp) void shutdown_osifile(void) { - extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osifile); if (afs_cold_shutdown) { afs_osicred_initialized = 0; diff --git a/src/afs/IRIX/osi_vfsops.c b/src/afs/IRIX/osi_vfsops.c index c1e29ebd6d..ddab23488f 100644 --- a/src/afs/IRIX/osi_vfsops.c +++ b/src/afs/IRIX/osi_vfsops.c @@ -207,7 +207,6 @@ afs_unmount(OSI_VFS_ARG(afsp), flags, cr) int flags; cred_t *cr; { - extern int afs_afs_cold_shutdown; struct vcache *tvc; vnode_t *vp, *rootvp = NULL; register struct afs_q *tq; diff --git a/src/afs/LINUX/osi_file.c b/src/afs/LINUX/osi_file.c index 68e9ee3887..d6b3974666 100644 --- a/src/afs/LINUX/osi_file.c +++ b/src/afs/LINUX/osi_file.c @@ -349,8 +349,6 @@ afs_osi_MapStrategy(int (*aproc) (struct buf * bp), register struct buf *bp) void shutdown_osifile(void) { - extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osifile); if (afs_cold_shutdown) { afs_osicred_initialized = 0; diff --git a/src/afs/NBSD/osi_file.c b/src/afs/NBSD/osi_file.c index 81d58d54a3..7f6a004e65 100644 --- a/src/afs/NBSD/osi_file.c +++ b/src/afs/NBSD/osi_file.c @@ -224,8 +224,6 @@ afs_osi_MapStrategy(int (*aproc) (), register struct buf *bp) void shutdown_osifile(void) { - extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osifile); if (afs_cold_shutdown) { afs_osicred_initialized = 0; diff --git a/src/afs/SOLARIS/osi_file.c b/src/afs/SOLARIS/osi_file.c index 05c3e26cea..3139e01ea2 100644 --- a/src/afs/SOLARIS/osi_file.c +++ b/src/afs/SOLARIS/osi_file.c @@ -398,8 +398,6 @@ afs_osi_MapStrategy(int (*aproc) (), register struct buf *bp) void shutdown_osifile(void) { - extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osifile); if (afs_cold_shutdown) { afs_osicred_initialized = 0; diff --git a/src/afs/afs_buffer.c b/src/afs/afs_buffer.c index 051cc600cb..cc9053272a 100644 --- a/src/afs/afs_buffer.c +++ b/src/afs/afs_buffer.c @@ -534,7 +534,6 @@ shutdown_bufferpackage(void) register struct buffer *tp; #endif int i; - extern int afs_cold_shutdown; AFS_STATCNT(shutdown_bufferpackage); /* Free all allocated Buffers and associated buffer pages */ diff --git a/src/afs/afs_osi_alloc.c b/src/afs/afs_osi_alloc.c index 158bc32c7c..e7108a7e9f 100644 --- a/src/afs/afs_osi_alloc.c +++ b/src/afs/afs_osi_alloc.c @@ -227,29 +227,34 @@ osi_AllocSmallSpace(size_t size) void shutdown_osinet(void) { - extern int afs_cold_shutdown; - AFS_STATCNT(shutdown_osinet); if (afs_cold_shutdown) { struct osi_packet *tp; while ((tp = freePacketList)) { freePacketList = tp->next; - afs_osi_Free(tp, AFS_LRALLOCSIZ); #ifdef KERNEL_HAVE_PIN unpin(tp, AFS_LRALLOCSIZ); #endif + afs_osi_Free(tp, AFS_LRALLOCSIZ); } while ((tp = freeSmallList)) { freeSmallList = tp->next; - afs_osi_Free(tp, AFS_SMALLOCSIZ); #ifdef KERNEL_HAVE_PIN unpin(tp, AFS_SMALLOCSIZ); #endif + afs_osi_Free(tp, AFS_SMALLOCSIZ); } LOCK_INIT(&osi_fsplock, "osi_fsplock"); LOCK_INIT(&osi_flplock, "osi_flplock"); } + if (afs_stats_cmperf.LargeBlocksActive || + afs_stats_cmperf.SmallBlocksActive) + { + afs_warn("WARNING: not all blocks freed: large %d small %d\n", + afs_stats_cmperf.LargeBlocksActive, + afs_stats_cmperf.SmallBlocksActive); + } } #endif