]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE12-linux-redhat-81-beta-support-20020107
authorDerrick Brashear <shadow@dementia.org>
Sat, 11 Jan 2003 07:53:11 +0000 (07:53 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sat, 11 Jan 2003 07:53:11 +0000 (07:53 +0000)
thanks to Sean McDermott for the errno.h fixes.
the rest is my fault, the configure tests as well as the kernel changes

(cherry picked from commit 4624fd2206027a83ca3a27dd701f0ef4d3f01cef)

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.h
src/sys/rmtsyss.c
src/venus/test/owntest.c

index 6244b45a98dd0a7efa9a105a6739e2759dbeb8dc..119ecb1d8d92346b6fe3e82ff06ccd7e02c1353e 100644 (file)
@@ -29,17 +29,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
 
 /* glue for RedHat kernel bug */
index 5f0f7436351e101fc6cf39ab8fd442c9f85c3721..844cd3eb1f385ab6729c01c2caa4c20432a4c488 100644 (file)
@@ -140,24 +140,32 @@ case $system in
                   [LINUX_BUILD_VNODE_FROM_INODE(config,afs)],
                   [LINUX_BUILD_VNODE_FROM_INODE(src/config,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
@@ -172,6 +180,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
@@ -187,7 +201,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])
@@ -205,7 +225,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 e031bd4568567feeb0b7b7f3c4ae221d49e62e67..c204299a92545404f00fcb4a3aa0cff4a99a253e 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 9c14afef479479463bce1fb65242ab10be9bc944..e7308e3bf03f6787db7ce9eed7882091a0e0c6a6 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
-#include "../h/sched.h"
 #define osi_Time() (xtime.tv_sec)
 #if  (CPU == sparc64)
 #define osi_GetTime(V) do { (*(V)).tv_sec = xtime.tv_sec; (*(V)).tv_usec = xtime.tv_usec; } while (0)
@@ -146,6 +170,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 dfa2d63ee7a969ef3055a901f220b00ea47685fe..814623328520fc76f53c8dd16cfdf48bf0d0cb8a 100644 (file)
@@ -444,18 +444,18 @@ void check_bad_parent(struct dentry *dp)
 struct task_struct *rxk_ListenerTask;
 
 void osi_linux_mask() {
-    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() {
-    spin_lock_irq(&rxk_ListenerTask->sigmask_lock);
+    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() {
index 050c5c32eec98f888b17fe3d44ffbe1f924ccdac..188f0e0c2cd673662d6d93cbc893a8c6f9d25283 100644 (file)
@@ -283,12 +283,20 @@ int init_module(void)
            sys_call_table=(void *) &(ptr[ -1 * (__NR_close-1024)]);
            break;
        }
+#else
+#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
@@ -303,6 +311,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 d8a4d6039798a574565b38693a8a9adc15294c81..be1034a8ef816fce7de6efe6bd7e6d70c567121a 100644 (file)
@@ -192,18 +192,19 @@ void afs_osi_Sleep(char *event)
        set_current_state(TASK_INTERRUPTIBLE);
        AFS_ASSERT_GLOCK();
        AFS_GUNLOCK();
-       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();
 
-       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);
        AFS_GLOCK();
     }
     remove_wait_queue(&evp->cond, &wait);
index 8fb4d2621687a9cf67827ca61d926dd6508768bd..b048ec382d8f3f4a77319336f5de6b9e722e4938 100644 (file)
@@ -807,11 +807,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 ee2b143af5db6be06e8eb7fb3e56a4d22386c5e9..ca3942dbc451dc0c00d6bb5048dcf1de0a436a93 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 ebe0cc2d23b45de0f7ef90afc580e70bb7b60b8e..a231974c16af57974198d80448c0ad236b6cf8fb 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 22d52086566123d6ce348e661ce8d8cfd0570208..85155ae86742d85ea84f9254ffc7ba5869228b33 100644 (file)
@@ -17,6 +17,7 @@
 #define RX_KMUTEX_H_
 
 #include "../rx/rx_kernel.h"   /* for osi_Panic() */
+#include "linux/sched.h"
 
 /* AFS_GLOBAL_RXLOCK_KERNEL is defined so that the busy tq code paths are
  * used. The thread can sleep when sending packets.
@@ -32,7 +33,6 @@
 struct coda_inode_info {};
 #endif
 #include "linux/wait.h"
-#include "linux/sched.h"
 
 typedef struct afs_kmutex {
     struct semaphore sem;
@@ -125,19 +125,19 @@ static inline int CV_WAIT(afs_kcondvar_t *cv, afs_kmutex_t *l)
     if (isAFSGlocked) AFS_GUNLOCK();
     MUTEX_EXIT(l);
 
-    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);
 
-    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();
     MUTEX_ENTER(l);
@@ -162,19 +162,19 @@ static inline int CV_TIMEDWAIT(afs_kcondvar_t *cv, afs_kmutex_t *l, int waittime
     if (isAFSGlocked) AFS_GUNLOCK();
     MUTEX_EXIT(l);
     
-    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);
 
     t = schedule_timeout(t);
     remove_wait_queue(cv, &wait);
     
-    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();
     MUTEX_ENTER(l);
index 4685cfe3534d93c847cf836bd3060448e9edd3e2..43682c6b7cccaad3940b501accb00920f18a3cf3 100644 (file)
@@ -27,6 +27,7 @@ RCSID("$Header$");
 #include <stdio.h>
 #include <errno.h>
 #include <rx/xdr.h>
+#include <errno.h>
 #include <signal.h>
 #ifdef HAVE_STRING_H
 #include <string.h>
index c39ec70d1fb1deaacb9e4f57f52ce39a1abd7519..188719f75360b245817492794c05ef394cb7d390 100644 (file)
@@ -16,6 +16,7 @@ RCSID("$Header$");
 #include <sys/file.h>
 #include <sys/stat.h>
 #include <sys/time.h>
+#include <errno.h>
 
 extern int errno;