shutdown-cleanup-20071213
authorDerrick Brashear <shadow@dementia.org>
Thu, 13 Dec 2007 19:18:06 +0000 (19:18 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 13 Dec 2007 19:18:06 +0000 (19:18 +0000)
LICENSE IPL10

get rid of cold_shutdown; it's in afs_prototypes.h.
log when we don't clean up memory

12 files changed:
src/afs/AIX/osi_file.c
src/afs/AIX/osi_vfsops.c
src/afs/DARWIN/osi_file.c
src/afs/FBSD/osi_file.c
src/afs/HPUX/osi_file.c
src/afs/IRIX/osi_file.c
src/afs/IRIX/osi_vfsops.c
src/afs/LINUX/osi_file.c
src/afs/NBSD/osi_file.c
src/afs/SOLARIS/osi_file.c
src/afs/afs_buffer.c
src/afs/afs_osi_alloc.c

index 97e2958..7f5e60c 100644 (file)
@@ -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;
index ad058f7..9c51c67 100644 (file)
@@ -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
index eddbb5c..d0f2f19 100644 (file)
@@ -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;
index 932e864..c7d7598 100644 (file)
@@ -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;
index 6b269b2..96365ab 100644 (file)
@@ -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;
index b66220a..731132f 100644 (file)
@@ -222,8 +222,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;
index c1e29eb..ddab234 100644 (file)
@@ -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;
index 68e9ee3..d6b3974 100644 (file)
@@ -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;
index 81d58d5..7f6a004 100644 (file)
@@ -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;
index 05c3e26..3139e01 100644 (file)
@@ -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;
index 821c2fb..2d949aa 100644 (file)
@@ -533,7 +533,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 */
index 158bc32..e7108a7 100644 (file)
@@ -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