From 091d64876bea6737dd6cf89a9232dd11d0072677 Mon Sep 17 00:00:00 2001 From: Chaskiel M Grundman Date: Sun, 16 Jan 2005 16:41:33 +0000 Subject: [PATCH] linux26-zomb-gcpags-cleanup-20050116 FIXES 17265 clean up for newer non-TASK_ZOMBIE kernels --- acinclude.m4 | 4 ++++ src/afs/afs_osi.c | 10 ++++++++++ src/cf/linux-test4.m4 | 15 +++++++++++++++ 3 files changed, 29 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index d837ef4fa..a3b453202 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -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 diff --git a/src/afs/afs_osi.c b/src/afs/afs_osi.c index e270f32c1..2f28f2848 100644 --- a/src/afs/afs_osi.c +++ b/src/afs/afs_osi.c @@ -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 diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 30578b152..582f49012 100644 --- a/src/cf/linux-test4.m4 +++ b/src/cf/linux-test4.m4 @@ -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 ], +[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"]) -- 2.39.5