linux-redhat-81-beta-support-20020107
authorDerrick Brashear <shadow@dementia.org>
Wed, 8 Jan 2003 05:52:11 +0000 (05:52 +0000)
committerDerrick Brashear <shadow@dementia.org>
Wed, 8 Jan 2003 05:52:11 +0000 (05:52 +0000)
thanks to Sean McDermott for the errno.h fixes.
the rest is my fault, the configure tests as well as the kernel changes

13 files changed:
acconfig.h
acinclude.m4
src/afs/LINUX/osi_groups.c
src/afs/LINUX/osi_machdep.h
src/afs/LINUX/osi_misc.c
src/afs/LINUX/osi_module.c
src/afs/LINUX/osi_sleep.c
src/afs/afs_osi.c
src/cf/linux-test4.m4
src/ptserver/pt_util.c
src/rx/LINUX/rx_kmutex.c
src/sys/rmtsyss.c
src/venus/test/owntest.c

index bc8f4c5..d08eb22 100644 (file)
@@ -31,17 +31,23 @@ static /**/const char *const rcsid[] = { (char *)rcsid, "\100(#)" msg }
 #undef FAST_RESTART
 #undef FULL_LISTVOL_SWITCH
 
+#undef COMPLETION_H_EXISTS
+#undef DEFINED_FOR_EACH_PROCESS
+#undef DEFINED_PREV_TASK
+#undef EXPORTED_KALLSYMS_ADDRESS
+#undef EXPORTED_KALLSYMS_SYMBOL
+#undef EXPORTED_SYS_CALL_TABLE
+#undef EXPORTED_TASKLIST_LOCK
 #undef INODE_SETATTR_NOT_VOID
+#undef RECALC_SIGPENDING_TAKES_VOID
 #undef STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
 #undef STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
-#undef STRUCT_INODE_HAS_I_TRUNCATE_SEM
-#undef STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
 #undef STRUCT_INODE_HAS_I_DEVICES
-#undef EXPORTED_TASKLIST_LOCK
-#undef EXPORTED_SYS_CALL_TABLE
-#undef EXPORTED_KALLSYMS_SYMBOL
-#undef EXPORTED_KALLSYMS_ADDRESS
-#undef COMPLETION_H_EXISTS
+#undef STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
+#undef STRUCT_INODE_HAS_I_TRUNCATE_SEM
+#undef STRUCT_TASK_STRUCT_HAS_PARENT
+#undef STRUCT_TASK_STRUCT_HAS_REAL_PARENT
+#undef STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK
 #undef ssize_t
 
 #undef HAVE_STRUCT_BUF
index b49aca4..92ac69d 100644 (file)
@@ -144,24 +144,32 @@ case $system in
                   [LINUX_BUILD_VNODE_FROM_INODE(src/config,afs)],
                   [LINUX_BUILD_VNODE_FROM_INODE(${srcdir}/src/config,src/afs/LINUX,${srcdir}/src/afs/LINUX)]
                 )
+                LINUX_COMPLETION_H_EXISTS
+                LINUX_DEFINES_FOR_EACH_PROCESS
+                LINUX_DEFINES_PREV_TASK
+                LINUX_EXPORTS_TASKLIST_LOCK
                 LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
                 LINUX_FS_STRUCT_ADDRESS_SPACE_HAS_GFP_MASK
                 LINUX_FS_STRUCT_INODE_HAS_I_TRUNCATE_SEM
                 LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS
                 LINUX_FS_STRUCT_INODE_HAS_I_DEVICES
                 LINUX_INODE_SETATTR_RETURN_TYPE
-                LINUX_COMPLETION_H_EXISTS
-                LINUX_EXPORTS_TASKLIST_LOCK
                 LINUX_NEED_RHCONFIG
+                LINUX_RECALC_SIGPENDING_ARG_TYPE
+                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT
+                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT
+                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK
                 LINUX_WHICH_MODULES
                  if test "x$ac_cv_linux_config_modversions" = "xno"; then
                    AC_MSG_WARN([Cannot determine sys_call_table status. assuming it's exported])
                    ac_cv_linux_exports_sys_call_table=yes
                  else
-                   LINUX_EXPORTS_SYS_CALL_TABLE
-                   LINUX_EXPORTS_KALLSYMS_SYMBOL
-                   LINUX_EXPORTS_KALLSYMS_ADDRESS
                    LINUX_EXPORTS_INIT_MM
+                   LINUX_EXPORTS_KALLSYMS_ADDRESS
+                   LINUX_EXPORTS_KALLSYMS_SYMBOL
+                   LINUX_EXPORTS_SYS_CALL_TABLE
+                   LINUX_EXPORTS_SYS_CHDIR
+                   LINUX_EXPORTS_SYS_CLOSE
                    if test "x$ac_cv_linux_exports_sys_call_table" = "xno"; then
                          linux_syscall_method=none
                          if test "x$ac_cv_linux_exports_init_mm" = "xyes"; then
@@ -176,6 +184,12 @@ case $system in
                          if test "x$linux_syscall_method" = "xnone"; then
                         AC_MSG_ERROR([no available sys_call_table access method])
                          fi
+                        if test "x$ac_cv_linux_exports_sys_chdir" = "xyes" ; then
+                         AC_DEFINE(EXPORTED_SYS_CHDIR, 1, [define if your linux kernel exports sys_chdir])
+                        fi
+                        if test "x$ac_cv_linux_exports_sys_close" = "xyes" ; then
+                         AC_DEFINE(EXPORTED_SYS_CLOSE, 1, [define if your linux kernel exports sys_close])
+                        fi
                    fi
                  fi
                 if test "x$ac_cv_linux_exports_tasklist_lock" = "xyes" ; then
@@ -191,7 +205,13 @@ case $system in
                   AC_DEFINE(EXPORTED_KALLSYMS_ADDRESS)
                  fi
                 if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then
-                 AC_DEFINE(COMPLETION_H_EXISTS, 1, [define if your h_exists exists])
+                 AC_DEFINE(COMPLETION_H_EXISTS, 1, [define if completion_h exists])
+                fi
+                if test "x$ac_cv_linux_defines_for_each_process" = "xyes" ; then
+                 AC_DEFINE(DEFINED_FOR_EACH_PROCESS, 1, [define if for_each_process defined])
+                fi
+                if test "x$ac_cv_linux_defines_prev_task" = "xyes" ; then
+                 AC_DEFINE(DEFINED_PREV_TASK, 1, [define if prev_task defined])
                 fi
                 if test "x$ac_cv_linux_func_inode_setattr_returns_int" = "xyes" ; then
                  AC_DEFINE(INODE_SETATTR_NOT_VOID, 1, [define if your setattr return return non-void])
@@ -209,7 +229,19 @@ case $system in
                  AC_DEFINE(STRUCT_INODE_HAS_I_DEVICES, 1, [define if you struct inode has i_devices])
                 fi
                 if test "x$ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers" = "xyes"; then 
-                 AC_DEFINE(STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, 1, [define if you struct inode has data_buffers])
+                 AC_DEFINE(STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, 1, [define if your struct inode has data_buffers])
+                fi
+                if test "x$ac_cv_linux_func_recalc_sigpending_takes_void" = "xyes"; then 
+                 AC_DEFINE(RECALC_SIGPENDING_TAKES_VOID, 1, [define if your recalc_sigpending takes void])
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_parent" = "xyes"; then 
+                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_PARENT, 1, [define if your struct task_struct has parent])
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_real_parent" = "xyes"; then 
+                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_REAL_PARENT, 1, [define if your struct task_struct has real_parent])
+                fi
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_sigmask_lock" = "xyes"; then 
+                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK, 1, [define if your struct task_struct has sigmask_lock])
                 fi
                 :
                fi
index ad7a080..5f41883 100644 (file)
@@ -33,14 +33,20 @@ static int afs_setgroups(cred_t **cr, int ngroups, gid_t *gidset, int change_par
  */
 int set_pag_in_parent(int pag, int g0, int g1)
 {
+#ifdef STRUCT_TASK_STRUCT_HAS_PARENT
+    gid_t *gp = current->parent->groups;
+#else
     gid_t *gp = current->p_pptr->groups;
+#endif
     int ngroups;
     int i;
 
     
+#ifdef STRUCT_TASK_STRUCT_HAS_PARENT
+    ngroups = current->parent->ngroups;
+#else
     ngroups = current->p_pptr->ngroups;
-    gp = current->p_pptr->groups;
-
+#endif
 
     if ((ngroups < 2) || (afs_get_pag_from_groups(gp[0], gp[1]) == NOPAG)) {
        /* We will have to shift grouplist to make room for pag */
@@ -57,7 +63,11 @@ int set_pag_in_parent(int pag, int g0, int g1)
     if (ngroups < NGROUPS)
        gp[ngroups] = NOGROUP;
 
+#ifdef STRUCT_TASK_STRUCT_HAS_PARENT
+    current->parent->ngroups = ngroups;
+#else
     current->p_pptr->ngroups = ngroups;
+#endif
     return 0;
 }
 
index b952a62..70b0f30 100644 (file)
 #undef getuerror
 
 #define getpid() current->pid
+#ifdef STRUCT_TASK_STRUCT_HAS_REAL_PARENT
+#define getppid() current->real_parent->pid
+#else
 #define getppid() current->p_opptr->pid
+#endif
+
+#ifdef RECALC_SIGPENDING_TAKES_VOID
+#define PENDING(p,b) has_pending_signals(&(p)->signal, (b))
+static inline void _recalc_sigpending_tsk(struct task_struct *t)
+{
+    t->sigpending = PENDING(&t->pending, &t->blocked) ||
+        PENDING(&t->sig->shared_pending, &t->blocked);
+}
+
+#define RECALC_SIGPENDING(X) _recalc_sigpending_tsk(X)
+#else
+#define RECALC_SIGPENDING(X) recalc_sigpending(X)
+#endif
+#ifdef STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK
+#define SIG_LOCK(X) spin_lock_irq(&X->sigmask_lock)
+#define SIG_UNLOCK(X) spin_unlock_irq(&X->sigmask_lock)
+#else
+#define SIG_LOCK(X) spin_lock_irq(&X->sig->siglock)
+#define SIG_UNLOCK(X) spin_unlock_irq(&X->sig->siglock)
+#endif
 
 
 #define afs_hz HZ
@@ -146,6 +171,7 @@ extern unsigned long afs_linux_page_offset;
 #define afs_linux_page_address(page) (afs_linux_page_offset + PAGE_SIZE * (page - mem_map))
 
 #if defined(__KERNEL__) && defined(CONFIG_SMP)
+#include "../h/sched.h"
 #include "linux/wait.h"
 
 extern struct semaphore afs_global_lock;
index 0a5cbc2..13499d1 100644 (file)
@@ -445,19 +445,18 @@ struct task_struct *rxk_ListenerTask;
 
 void osi_linux_mask(void)
 {
-    spin_lock_irq(&current->sigmask_lock);
+    SIG_LOCK(current);
     sigfillset(&current->blocked);
-    recalc_sigpending(current);
-    spin_unlock_irq(&current->sigmask_lock);
+    RECALC_SIGPENDING(current);
+    SIG_UNLOCK(current);
 }
-
-void osi_linux_unmask(void)
-{
-    spin_lock_irq(&rxk_ListenerTask->sigmask_lock);
+  
+void osi_linux_unmask() {
+    SIG_LOCK(rxk_ListenerTask);
     sigemptyset(&rxk_ListenerTask->blocked);
     flush_signals(rxk_ListenerTask);
-    recalc_sigpending(rxk_ListenerTask);
-    spin_unlock_irq(&rxk_ListenerTask->sigmask_lock);
+    RECALC_SIGPENDING(rxk_ListenerTask);
+    SIG_UNLOCK(rxk_ListenerTask);
 }
 
 void osi_linux_rxkreg(void)
index a230222..2fc9e3a 100644 (file)
@@ -287,11 +287,19 @@ int init_module(void)
            break;
        }
 #else
-      if (ptr[0] == (unsigned long)&sys_exit &&
-         ptr[__NR_open - __NR_exit] == (unsigned long)&sys_open) {
-       sys_call_table=ptr - __NR_exit;
-       break;
-      }
+#if defined(EXPORTED_SYS_CHDIR) && defined(EXPORTED_SYS_CLOSE)
+        if (ptr[0] == (unsigned long)&sys_close &&
+           ptr[__NR_chdir - __NR_close] == (unsigned long)&sys_chdir) {
+           sys_call_table=ptr - __NR_close;
+           break;
+       }
+#else
+       if (ptr[0] == (unsigned long)&sys_exit &&
+           ptr[__NR_open - __NR_exit] == (unsigned long)&sys_open) {
+           sys_call_table=ptr - __NR_exit;
+           break;
+       }
+#endif
 #endif
     }
 #ifdef EXPORTED_KALLSYMS_ADDRESS
@@ -306,6 +314,7 @@ int init_module(void)
       printf("Failed to find address of sys_call_table\n");
       return -EIO;
     }
+    printf("Found sys_call_table at %x\n", sys_call_table);
 # ifdef AFS_SPARC64_LINUX20_ENV
     error cant support this yet.
 #endif
@@ -434,10 +443,14 @@ static long get_page_offset(void)
 #if defined(AFS_PPC_LINUX22_ENV) || defined(AFS_SPARC64_LINUX20_ENV) || defined(AFS_SPARC_LINUX20_ENV) || defined(AFS_ALPHA_LINUX20_ENV) || defined(AFS_S390_LINUX22_ENV) || defined(AFS_IA64_LINUX20_ENV) || defined(AFS_PARISC_LINUX24_ENV)
     return PAGE_OFFSET;
 #else
-    struct task_struct *p;
+    struct task_struct *p, *q;
 
     /* search backward thru the circular list */
+#ifdef DEFINED_PREV_TASK
+    for(q = current; p = q; q = prev_task(p))
+#else
     for(p = current; p; p = p->prev_task)
+#endif
        if (p->pid == 1)
            return p->addr_limit.seg;
 
index a85448d..47b7b95 100644 (file)
@@ -208,18 +208,18 @@ void afs_osi_Sleep(void *event)
 {
     sigset_t saved_set;
 
-    spin_lock_irq(&current->sigmask_lock);
+    SIG_LOCK(current);
     saved_set = current->blocked;
     sigfillset(&current->blocked);
-    recalc_sigpending(current);
-    spin_unlock_irq(&current->sigmask_lock);
+    RECALC_SIGPENDING(current);
+    SIG_UNLOCK(current);
 
     afs_osi_SleepSig(event);
 
-    spin_lock_irq(&current->sigmask_lock);
+    SIG_LOCK(current);
     current->blocked = saved_set;
-    recalc_sigpending(current);
-    spin_unlock_irq(&current->sigmask_lock);
+    RECALC_SIGPENDING(current);
+    SIG_UNLOCK(current);
 }
 
 /* osi_TimedSleep
index baf2b34..219376b 100644 (file)
@@ -798,11 +798,19 @@ void afs_osi_TraverseProcTable()
 #ifdef EXPORTED_TASKLIST_LOCK
     read_lock(&tasklist_lock);
 #endif
+#ifdef DEFINED_FOR_EACH_PROCESS
+    for_each_process(p) if (p->pid) {
+        if (p->state & TASK_ZOMBIE)
+            continue;
+       afs_GCPAGs_perproc_func(p);
+    }
+#else
     for_each_task(p) if (p->pid) {
         if (p->state & TASK_ZOMBIE)
             continue;
        afs_GCPAGs_perproc_func(p);
     }
+#endif
 #ifdef EXPORTED_TASKLIST_LOCK
     read_unlock(&tasklist_lock);
 #endif
index 5b564ed..ca3942d 100644 (file)
@@ -1,35 +1,57 @@
-AC_DEFUN(LINUX_EXPORTS_TASKLIST_LOCK, [
-AC_MSG_CHECKING(for exported tasklist_lock)
+AC_DEFUN(LINUX_COMPLETION_H_EXISTS, [
+AC_MSG_CHECKING(for linux/completion.h existance)
 save_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_exports_tasklist_lock,
+AC_CACHE_VAL(ac_cv_linux_completion_h_exists,
 [
 AC_TRY_COMPILE(
-[#include <linux/modversions.h>],
-[#ifndef __ver_tasklist_lock
-#error tasklist_lock not exported
+[#include <linux/completion.h>
+#include <linux/version.h>],
+[struct completion _c;
+#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,8)
+lose
+#endif
+],
+ac_cv_linux_completion_h_exists=yes,
+ac_cv_linux_completion_h_exists=no)])
+AC_MSG_RESULT($ac_cv_linux_completion_h_exists)
+CPPFLAGS="$save_CPPFLAGS"])
+
+
+AC_DEFUN(LINUX_DEFINES_FOR_EACH_PROCESS, [
+AC_MSG_CHECKING(for defined for_each_process)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_defines_for_each_process,
+[
+AC_TRY_COMPILE(
+[#include <linux/sched.h>],
+[#ifndef for_each_process(p)
+#error for_each_process not defined
 #endif],
-ac_cv_linux_exports_tasklist_lock=yes,
-ac_cv_linux_exports_tasklist_lock=no)])
-AC_MSG_RESULT($ac_cv_linux_exports_tasklist_lock)
+ac_cv_linux_defines_for_each_process=yes,
+ac_cv_linux_defines_for_each_process=no)])
+AC_MSG_RESULT($ac_cv_linux_defines_for_each_process)
 CPPFLAGS="$save_CPPFLAGS"])
 
-AC_DEFUN(LINUX_EXPORTS_SYS_CALL_TABLE, [
-AC_MSG_CHECKING(for exported sys_call_table)
+
+AC_DEFUN(LINUX_DEFINES_PREV_TASK, [
+AC_MSG_CHECKING(for defined prev_task)
 save_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_exports_sys_call_table,
+AC_CACHE_VAL(ac_cv_linux_defines_prev_task,
 [
 AC_TRY_COMPILE(
-[#include <linux/modversions.h>],
-[#ifndef __ver_sys_call_table
-#error sys_call_table not exported
+[#include <linux/sched.h>],
+[#ifndef prev_task(p)
+#error prev_task not defined
 #endif],
-ac_cv_linux_exports_sys_call_table=yes,
-ac_cv_linux_exports_sys_call_table=no)])
-AC_MSG_RESULT($ac_cv_linux_exports_sys_call_table)
+ac_cv_linux_defines_prev_task=yes,
+ac_cv_linux_defines_prev_task=no)])
+AC_MSG_RESULT($ac_cv_linux_defines_prev_task)
 CPPFLAGS="$save_CPPFLAGS"])
 
+
 AC_DEFUN(LINUX_EXPORTS_INIT_MM, [
 AC_MSG_CHECKING(for exported init_mm)
 save_CPPFLAGS="$CPPFLAGS"
@@ -46,6 +68,24 @@ ac_cv_linux_exports_init_mm=no)])
 AC_MSG_RESULT($ac_cv_linux_exports_init_mm)
 CPPFLAGS="$save_CPPFLAGS"])
 
+
+AC_DEFUN(LINUX_EXPORTS_KALLSYMS_ADDRESS, [
+AC_MSG_CHECKING(for exported kallsyms_address_to_symbol)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_exports_kallsyms_address,
+[
+AC_TRY_COMPILE(
+[#include <linux/modversions.h>],
+[#ifndef __ver_kallsyms_address_to_symbol
+#error kallsyms_address_to_symbol not exported
+#endif],
+ac_cv_linux_exports_kallsyms_address=yes,
+ac_cv_linux_exports_kallsyms_address=no)])
+AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_address)
+CPPFLAGS="$save_CPPFLAGS"])
+
+
 AC_DEFUN(LINUX_EXPORTS_KALLSYMS_SYMBOL, [
 AC_MSG_CHECKING(for exported kallsyms_symbol_to_address)
 save_CPPFLAGS="$CPPFLAGS"
@@ -62,56 +102,107 @@ ac_cv_linux_exports_kallsyms_symbol=no)])
 AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_symbol)
 CPPFLAGS="$save_CPPFLAGS"])
 
-AC_DEFUN(LINUX_EXPORTS_KALLSYMS_ADDRESS, [
-AC_MSG_CHECKING(for exported kallsyms_address_to_symbol)
+
+AC_DEFUN(LINUX_EXPORTS_SYS_CALL_TABLE, [
+AC_MSG_CHECKING(for exported sys_call_table)
 save_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_exports_kallsyms_address,
+AC_CACHE_VAL(ac_cv_linux_exports_sys_call_table,
 [
 AC_TRY_COMPILE(
 [#include <linux/modversions.h>],
-[#ifndef __ver_kallsyms_address_to_symbol
-#error kallsyms_address_to_symbol not exported
+[#ifndef __ver_sys_call_table
+#error sys_call_table not exported
 #endif],
-ac_cv_linux_exports_kallsyms_address=yes,
-ac_cv_linux_exports_kallsyms_address=no)])
-AC_MSG_RESULT($ac_cv_linux_exports_kallsyms_address)
+ac_cv_linux_exports_sys_call_table=yes,
+ac_cv_linux_exports_sys_call_table=no)])
+AC_MSG_RESULT($ac_cv_linux_exports_sys_call_table)
 CPPFLAGS="$save_CPPFLAGS"])
 
-AC_DEFUN(LINUX_COMPLETION_H_EXISTS, [
-AC_MSG_CHECKING(for linux/completion.h existance)
+
+AC_DEFUN(LINUX_EXPORTS_SYS_CHDIR, [
+AC_MSG_CHECKING(for exported sys_chdir)
 save_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_completion_h_exists,
+AC_CACHE_VAL(ac_cv_linux_exports_sys_chdir,
 [
 AC_TRY_COMPILE(
-[#include <linux/completion.h>
-#include <linux/version.h?],
-[struct completion _c;
-#if LINUX_VERSION_CODE <= KERNEL_VERSION(2,4,8)
-lose
-#endif
-],
-ac_cv_linux_completion_h_exists=yes,
-ac_cv_linux_completion_h_exists=no)])
-AC_MSG_RESULT($ac_cv_linux_completion_h_exists)
+[#include <linux/modversions.h>],
+[#ifndef __ver_sys_chdir
+#error sys_chdir not exported
+#endif],
+ac_cv_linux_exports_sys_chdir=yes,
+ac_cv_linux_exports_sys_chdir=no)])
+AC_MSG_RESULT($ac_cv_linux_exports_sys_chdir)
 CPPFLAGS="$save_CPPFLAGS"])
 
-AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED, [
-AC_MSG_CHECKING(for i_mmap_shared in struct inode)
+
+AC_DEFUN(LINUX_EXPORTS_SYS_CLOSE, [
+AC_MSG_CHECKING(for exported sys_close)
 save_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mmap_shared,
+AC_CACHE_VAL(ac_cv_linux_exports_sys_close,
+[
+AC_TRY_COMPILE(
+[#include <linux/modversions.h>],
+[#ifndef __ver_sys_close
+#error sys_close not exported
+#endif],
+ac_cv_linux_exports_sys_close=yes,
+ac_cv_linux_exports_sys_close=no)])
+AC_MSG_RESULT($ac_cv_linux_exports_sys_close)
+CPPFLAGS="$save_CPPFLAGS"])
+
+
+AC_DEFUN(LINUX_EXPORTS_TASKLIST_LOCK, [
+AC_MSG_CHECKING(for exported tasklist_lock)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_exports_tasklist_lock,
+[
+AC_TRY_COMPILE(
+[#include <linux/modversions.h>],
+[#ifndef __ver_tasklist_lock
+#error tasklist_lock not exported
+#endif],
+ac_cv_linux_exports_tasklist_lock=yes,
+ac_cv_linux_exports_tasklist_lock=no)])
+AC_MSG_RESULT($ac_cv_linux_exports_tasklist_lock)
+CPPFLAGS="$save_CPPFLAGS"])
+
+
+AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_CDEV, [
+AC_MSG_CHECKING(for i_cdev in struct inode)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, 
 [
 AC_TRY_COMPILE(
 [#include <linux/fs.h>],
 [struct inode _inode;
-printf("%d\n", _inode.i_mmap_shared);],
-ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes,
-ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared)
+printf("%d\n", _inode.i_cdev);], 
+ac_cv_linux_fs_struct_inode_has_i_cdev=yes,
+ac_cv_linux_fs_struct_inode_has_i_cdev=no)])
+AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev)
+CPPFLAGS="$save_CPPFLAGS"])
+
+
+AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_DEVICES, [
+AC_MSG_CHECKING(for i_devices in struct inode)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, 
+[
+AC_TRY_COMPILE(
+[#include <linux/fs.h>],
+[struct inode _inode;
+printf("%d\n", _inode.i_devices);], 
+ac_cv_linux_fs_struct_inode_has_i_devices=yes,
+ac_cv_linux_fs_struct_inode_has_i_devices=no)])
+AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_devices)
 CPPFLAGS="$save_CPPFLAGS"])
 
+
 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_DIRTY_DATA_BUFFERS, [
 AC_MSG_CHECKING(for i_dirty_data_buffers in struct inode)
 save_CPPFLAGS="$CPPFLAGS"
@@ -127,6 +218,7 @@ ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers=no)])
 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_dirty_data_buffers)
 CPPFLAGS="$save_CPPFLAGS"])
 
+
 AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_MAPPING_OVERLOAD, [
 AC_MSG_CHECKING(for i_mapping_overload in struct inode)
 save_CPPFLAGS="$CPPFLAGS"
@@ -142,33 +234,81 @@ ac_cv_linux_fs_struct_inode_has_i_mapping_overload=no)])
 AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mapping_overload)
 CPPFLAGS="$save_CPPFLAGS"])
 
-AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_CDEV, [
-AC_MSG_CHECKING(for i_cdev in struct inode)
+
+AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_MMAP_SHARED, [
+AC_MSG_CHECKING(for i_mmap_shared in struct inode)
 save_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, 
+AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_mmap_shared,
 [
 AC_TRY_COMPILE(
 [#include <linux/fs.h>],
 [struct inode _inode;
-printf("%d\n", _inode.i_cdev);], 
-ac_cv_linux_fs_struct_inode_has_i_cdev=yes,
-ac_cv_linux_fs_struct_inode_has_i_cdev=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_cdev)
+printf("%d\n", _inode.i_mmap_shared);],
+ac_cv_linux_fs_struct_inode_has_i_mmap_shared=yes,
+ac_cv_linux_fs_struct_inode_has_i_mmap_shared=no)])
+AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_mmap_shared)
 CPPFLAGS="$save_CPPFLAGS"])
 
-AC_DEFUN(LINUX_FS_STRUCT_INODE_HAS_I_DEVICES, [
-AC_MSG_CHECKING(for i_devices in struct inode)
+
+AC_DEFUN(LINUX_RECALC_SIGPENDING_ARG_TYPE,[
+AC_MSG_CHECKING(for recalc_sigpending arg type)
 save_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
-AC_CACHE_VAL(ac_cv_linux_fs_struct_inode_has_i_cdev, 
+AC_CACHE_VAL(ac_cv_linux_func_recalc_sigpending_takes_void,
 [
 AC_TRY_COMPILE(
-[#include <linux/fs.h>],
-[struct inode _inode;
-printf("%d\n", _inode.i_devices);], 
-ac_cv_linux_fs_struct_inode_has_i_devices=yes,
-ac_cv_linux_fs_struct_inode_has_i_devices=no)])
-AC_MSG_RESULT($ac_cv_linux_fs_struct_inode_has_i_devices)
+[#include <linux/sched.h>],
+[recalc_sigpending();],
+ac_cv_linux_func_recalc_sigpending_takes_void=yes,
+ac_cv_linux_func_recalc_sigpending_takes_void=no)])
+AC_MSG_RESULT($ac_cv_linux_func_recalc_sigpending_takes_void)
+CPPFLAGS="$save_CPPFLAGS"])
+
+
+AC_DEFUN(LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_PARENT, [
+AC_MSG_CHECKING(for parent in struct task_struct)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_parent,
+[
+AC_TRY_COMPILE(
+[#include <linux/sched.h>],
+[struct task_struct _tsk;
+printf("%d\n", _tsk.parent);],
+ac_cv_linux_sched_struct_task_struct_has_parent=yes,
+ac_cv_linux_sched_struct_task_struct_has_parent=no)])
+AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_parent)
+CPPFLAGS="$save_CPPFLAGS"])
+
+
+AC_DEFUN(LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_REAL_PARENT, [
+AC_MSG_CHECKING(for real_parent in struct task_struct)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_real_parent,
+[
+AC_TRY_COMPILE(
+[#include <linux/sched.h>],
+[struct task_struct _tsk;
+printf("%d\n", _tsk.real_parent);],
+ac_cv_linux_sched_struct_task_struct_has_real_parent=yes,
+ac_cv_linux_sched_struct_task_struct_has_real_parent=no)])
+AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_real_parent)
 CPPFLAGS="$save_CPPFLAGS"])
 
+
+AC_DEFUN(LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGMASK_LOCK, [
+AC_MSG_CHECKING(for sigmask_lock in struct task_struct)
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="-I${LINUX_KERNEL_PATH}/include -D__KERNEL__ $CPPFLAGS"
+AC_CACHE_VAL(ac_cv_linux_sched_struct_task_struct_has_sigmask_lock,
+[
+AC_TRY_COMPILE(
+[#include <linux/sched.h>],
+[struct task_struct _tsk;
+printf("%d\n", _tsk.sigmask_lock);],
+ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=yes,
+ac_cv_linux_sched_struct_task_struct_has_sigmask_lock=no)])
+AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_sigmask_lock)
+CPPFLAGS="$save_CPPFLAGS"])
index 8a5cae4..f57d6dd 100644 (file)
@@ -16,6 +16,7 @@
 #include <stdio.h>
 #include <ctype.h>
 #include <string.h>
+#include <errno.h>
 #include <sys/file.h>
 
 #include <afsconfig.h>
index 98b90fa..b79172f 100644 (file)
@@ -84,21 +84,21 @@ int afs_cv_wait(afs_kcondvar_t *cv, afs_kmutex_t *l, int sigok)
     MUTEX_EXIT(l);
 
     if (!sigok) {
-       spin_lock_irq(&current->sigmask_lock);
+       SIG_LOCK(current);
        saved_set = current->blocked;
        sigfillset(&current->blocked);
-       recalc_sigpending(current);
-       spin_unlock_irq(&current->sigmask_lock);
+       RECALC_SIGPENDING(current);
+       SIG_UNLOCK(current);
     }
 
     schedule();
     remove_wait_queue(cv, &wait);
 
     if (!sigok) {
-       spin_lock_irq(&current->sigmask_lock);
+       SIG_LOCK(current);
        current->blocked = saved_set;
-       recalc_sigpending(current);
-       spin_unlock_irq(&current->sigmask_lock);
+       RECALC_SIGPENDING(current);
+       SIG_UNLOCK(current);
     }
 
     if (isAFSGlocked) AFS_GLOCK();
index abd9164..65e1815 100644 (file)
@@ -26,6 +26,7 @@ RCSID("$Header$");
 #include <sys/file.h>
 #include <stdio.h>
 #include <rx/xdr.h>
+#include <errno.h>
 #include <signal.h>
 #ifdef HAVE_STRING_H
 #include <string.h>
index fab6c9e..59dadfa 100644 (file)
@@ -19,6 +19,7 @@ RCSID("$Header$");
 #include <sys/file.h>
 #include <sys/stat.h>
 #include <sys/time.h>
+#include <errno.h>
 
 extern int errno;