linux-2620-rc1-update-20061228
authorMarc Dionne <marc.dionne@technoconseil.com>
Thu, 28 Dec 2006 21:28:31 +0000 (21:28 +0000)
committerDerrick Brashear <shadow@dementia.org>
Thu, 28 Dec 2006 21:28:31 +0000 (21:28 +0000)
FIXES 49890

updates for linux 2.6.20-rc1

acinclude.m4
src/afs/LINUX/osi_sleep.c
src/afs/LINUX/osi_vfsops.c
src/afs/afs_call.c
src/cf/linux-test4.m4
src/rx/LINUX/rx_kmutex.c
src/rx/LINUX/rx_knet.c
src/rx/rx_kcommon.h

index 204b7d2..c43062d 100644 (file)
@@ -614,6 +614,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_RLIM
                 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM
                 LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE
+                LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TODO
                 LINUX_GET_SB_HAS_STRUCT_VFSMOUNT
                 LINUX_STATFS_TAKES_DENTRY
                 LINUX_REFRIGERATOR
@@ -621,6 +622,8 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK
                 LINUX_DO_SYNC_READ
                 LINUX_GENERIC_FILE_AIO_READ
+                LINUX_FREEZER_H_EXISTS
+                LINUX_INIT_WORK_HAS_DATA
                  LINUX_EXPORTS_SYS_CHDIR
                  LINUX_EXPORTS_SYS_CLOSE
                  LINUX_EXPORTS_SYS_OPEN
@@ -691,6 +694,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 if test "x$ac_cv_linux_completion_h_exists" = "xyes" ; then
                  AC_DEFINE(COMPLETION_H_EXISTS, 1, [define if completion_h exists])
                 fi
+                if test "x$ac_cv_linux_config_h_exists" = "xyes" ; then
+                 AC_DEFINE(CONFIG_H_EXISTS, 1, [define if config.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
@@ -784,6 +790,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 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
+                if test "x$ac_cv_linux_sched_struct_task_struct_has_todo" = "xyes"; then 
+                 AC_DEFINE(STRUCT_TASK_STRUCT_HAS_TODO, 1, [define if your struct task_struct has todo])
+                fi
                 if test "x$ac_cv_linux_get_sb_has_struct_vfsmount" = "xyes"; then
                  AC_DEFINE(GET_SB_HAS_STRUCT_VFSMOUNT, 1, [define if your get_sb_nodev needs a struct vfsmount argument])
                 fi
@@ -808,6 +817,12 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*)
                 if test "x$ac_cv_linux_func_d_revalidate_takes_nameidata" = "xyes" ; then
                  AC_DEFINE(DOP_REVALIDATE_TAKES_NAMEIDATA, 1, [define if your dops.d_revalidate takes a nameidata argument])
                 fi
+                if test "x$ac_cv_linux_freezer_h_exists" = "xyes" ; then
+                 AC_DEFINE(FREEZER_H_EXISTS, 1, [define if you have linux/freezer.h])
+                fi
+                if test "x$ac_cv_linux_init_work_has_data" = "xyes" ; then
+                 AC_DEFINE(INIT_WORK_HAS_DATA, 1, [define if INIT_WORK takes a data (3rd) argument])
+                fi
                 :
                fi
 esac
index 3a9cda9..1e87378 100644 (file)
@@ -17,6 +17,8 @@ RCSID
 #include "afsincludes.h"       /* Afs-based standard headers */
 #include "afs/afs_stats.h"     /* afs statistics */
 
+#include <linux/freezer.h>
+
 static int osi_TimedSleep(char *event, afs_int32 ams, int aintok);
 
 static char waitV, dummyV;
@@ -198,7 +200,11 @@ afs_osi_SleepSig(void *event)
 #ifdef PF_FREEZE
            current->flags & PF_FREEZE
 #else
+#if defined(STRUCT_TASK_STRUCT_HAS_TODO)
            !current->todo
+#else
+            test_ti_thread_flag(current->thread_info, TIF_FREEZE)
+#endif
 #endif
            )
 #ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE
@@ -292,7 +298,11 @@ osi_TimedSleep(char *event, afs_int32 ams, int aintok)
 #ifdef PF_FREEZE
            current->flags & PF_FREEZE
 #else
+#if defined(STRUCT_TASK_STRUCT_HAS_TODO)
            !current->todo
+#else
+            test_ti_thread_flag(current->thread_info, TIF_FREEZE)
+#endif
 #endif
            )
 #ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE
index 4613b79..2ed7c74 100644 (file)
@@ -276,7 +276,11 @@ afs_alloc_inode(struct super_block *sb)
 {
     struct vcache *vcp;
 
+#if defined(SLAB_KERNEL)
     vcp = (struct vcache *) kmem_cache_alloc(afs_inode_cachep, SLAB_KERNEL);
+#else
+    vcp = (struct vcache *) kmem_cache_alloc(afs_inode_cachep, GFP_KERNEL);
+#endif
     if (!vcp)
        return NULL;
 
index 2156aad..3888b36 100644 (file)
@@ -238,6 +238,9 @@ afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5,
 
 #if defined(AFS_LINUX24_ENV) && defined(COMPLETION_H_EXISTS)
 struct afsd_thread_info {
+#if !defined(INIT_WORK_HAS_DATA)
+    struct work_struct tq;
+#endif
     unsigned long parm;
     struct completion *complete;
 };
@@ -370,9 +373,17 @@ afsd_thread(void *rock)
 }
 
 void
+#if !defined(INIT_WORK_HAS_DATA)
+afsd_launcher(struct work_struct *work)
+#else
 afsd_launcher(void *rock)
+#endif
 {
-    if (!kernel_thread(afsd_thread, rock, CLONE_VFORK | SIGCHLD))
+#if !defined(INIT_WORK_HAS_DATA)
+    struct afsd_thread_info *rock = container_of(work, struct afsd_thread_info, tq);
+#endif
+
+    if (!kernel_thread(afsd_thread, (void *)rock, CLONE_VFORK | SIGCHLD))
        printf("kernel_thread failed. afs startup will not complete\n");
 }
 
@@ -411,8 +422,13 @@ afs_DaemonOp(long parm, long parm2, long parm3, long parm4, long parm5,
     info.complete = &c;
     info.parm = parm;
 #if defined(AFS_LINUX26_ENV)
+#if !defined(INIT_WORK_HAS_DATA)
+    INIT_WORK(&info.tq, afsd_launcher);
+    schedule_work(&info.tq);
+#else
     INIT_WORK(&tq, afsd_launcher, &info);
     schedule_work(&tq);
+#endif
 #else
     tq.sync = 0;
     INIT_LIST_HEAD(&tq.list);
index 5457fec..17675cf 100644 (file)
@@ -719,3 +719,43 @@ AC_DEFUN([LINUX_GENERIC_FILE_AIO_READ], [
     AC_DEFINE([GENERIC_FILE_AIO_READ], 1, [define if your kernel has generic_file_aio_read()])
   fi])
 
+AC_DEFUN([LINUX_FREEZER_H_EXISTS], [
+  AC_MSG_CHECKING([for linux/freezer.h existance])
+  AC_CACHE_VAL([ac_cv_linux_freezer_h_exists], [
+    save_CPPFLAGS="$CPPFLAGS"
+    CPPFLAGS="$CPPFLAGS -Werror-implicit-function-declaration"
+    AC_TRY_KBUILD(
+[#include <linux/freezer.h>],
+[return;],
+      ac_cv_linux_freezer_h_exists=yes,
+      ac_cv_linux_freezer_h_exists=no)])
+  AC_MSG_RESULT($ac_cv_linux_freezer_h_exists)
+  if test "x$ac_cv_linux_freezer_h_exists" = "xyes"; then
+    AC_DEFINE([FREEZER_H_EXISTS], 1, [define if linux/freezer.h exists])
+  fi])
+
+AC_DEFUN([LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TODO], [
+  AC_MSG_CHECKING([for todo in struct task_struct])
+  AC_CACHE_VAL([ac_cv_linux_sched_struct_task_struct_has_todo], [
+    AC_TRY_KBUILD(
+[#include <linux/sched.h>],
+[struct task_struct _tsk;
+printk("%d\n", _tsk.todo);],
+      ac_cv_linux_sched_struct_task_struct_has_todo=yes,
+      ac_cv_linux_sched_struct_task_struct_has_todo=no)])
+  AC_MSG_RESULT($ac_cv_linux_sched_struct_task_struct_has_todo)])
+
+AC_DEFUN([LINUX_INIT_WORK_HAS_DATA], [
+  AC_MSG_CHECKING([whether INIT_WORK has a _data argument])
+  AC_CACHE_VAL([ac_cv_linux_init_work_has_data], [
+    AC_TRY_KBUILD(
+[#include <linux/workqueue.h>],
+[ 
+void f(struct work_struct *w) {}
+struct work_struct *w;
+int *i;
+INIT_WORK(w,f,i);],
+      ac_cv_linux_init_work_has_data=yes,
+      ac_cv_linux_init_work_has_data=no)])
+  AC_MSG_RESULT($ac_cv_linux_init_work_has_data)])
+
index dbd3b32..a4c863f 100644 (file)
@@ -119,7 +119,11 @@ afs_cv_wait(afs_kcondvar_t * cv, afs_kmutex_t * l, int sigok)
 #ifdef PF_FREEZE
            current->flags & PF_FREEZE
 #else
+#if defined(STRUCT_TASK_STRUCT_HAS_TODO)
            !current->todo
+#else
+           test_ti_thread_flag(current->thread_info, TIF_FREEZE)
+#endif
 #endif
            )
 #ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE
index 4e176f6..4b2720e 100644 (file)
@@ -170,7 +170,11 @@ osi_NetReceive(osi_socket so, struct sockaddr_in *from, struct iovec *iov,
 #ifdef PF_FREEZE
            current->flags & PF_FREEZE
 #else
+#if defined(STRUCT_TASK_STRUCT_HAS_TODO)
            !current->todo
+#else
+            test_ti_thread_flag(current->thread_info, TIF_FREEZE)
+#endif
 #endif
            )
 #ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE
index acb036f..a2903d0 100644 (file)
@@ -112,6 +112,7 @@ typedef unsigned short etap_event_t;
 #endif
 #ifdef AFS_LINUX22_ENV
 #include "h/sched.h"
+#include "h/freezer.h"
 #include "h/netdevice.h"
 #include "linux/if.h"
 #else