linux26-zomb-gcpags-cleanup-20050116
authorChaskiel M Grundman <cg2v@andrew.cmu.edu>
Sun, 16 Jan 2005 16:41:33 +0000 (16:41 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sun, 16 Jan 2005 16:41:33 +0000 (16:41 +0000)
FIXES 17265

clean up for newer non-TASK_ZOMBIE kernels

acinclude.m4
src/afs/afs_osi.c
src/cf/linux-test4.m4

index d837ef4..a3b4532 100644 (file)
@@ -585,6 +585,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK
                 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_RLIM
                 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM
+                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE
                 LINUX_WHICH_MODULES
                  if test "x$ac_cv_linux_config_modversions" = "xno" -o $AFS_SYSKVERS -ge 26; then
                    AC_MSG_WARN([Cannot determine sys_call_table status. assuming it isn't exported])
@@ -722,6 +723,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 if test "x$ac_cv_linux_sched_struct_task_struct_has_signal_rlim" = "xyes"; then 
                  AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM, 1, [define if your struct task_struct has signal->rlim])
                 fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_exit_state" = "xyes"; then 
+                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_EXIT_STATE, 1, [define if your struct task_struct has exit_state])
+                fi
                 :
                fi
 esac
index e270f32..2f28f28 100644 (file)
@@ -860,14 +860,24 @@ afs_osi_TraverseProcTable()
 #endif
 #ifdef DEFINED_FOR_EACH_PROCESS
     for_each_process(p) if (p->pid) {
+#ifdef STRUCT_TASK_STRUCT_HAS_EXIT_STATE
+       if (p->exit_state)
+           continue;
+#else
        if (p->state & TASK_ZOMBIE)
            continue;
+#endif
        afs_GCPAGs_perproc_func(p);
     }
 #else
     for_each_task(p) if (p->pid) {
+#ifdef STRUCT_TASK_STRUCT_HAS_EXIT_STATE
+       if (p->exit_state)
+           continue;
+#else
        if (p->state & TASK_ZOMBIE)
            continue;
+#endif
        afs_GCPAGs_perproc_func(p);
     }
 #endif
index 30578b1..582f490 100644 (file)
@@ -422,3 +422,18 @@ ac_cv_linux_sched_struct_task_struct_has_signal_rlim=yes,
 ac_cv_linux_sched_struct_task_struct_has_signal_rlim=no)])
 AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_signal_rlim)
 CPPFLAGS="$save_CPPFLAGS"])
+
+AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE], [
+AC_MSG_CHECKING(for exit_state in struct task_struct)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -I${LINUX_KERNEL_PATH}/include/asm/mach-${SUBARCH} -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_exit_state,
+[
+AC_TRY_COMPILE(
+[#include <linux/sched.h>],
+[struct task_struct _tsk;
+printf("%d\n", _tsk.exit_state);],
+ac_cv_linux_sched_struct_task_struct_has_exit_state=yes,
+ac_cv_linux_sched_struct_task_struct_has_exit_state=no)])
+AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_exit_state)
+CPPFLAGS="$save_CPPFLAGS"])