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
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
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
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
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
#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;
#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
#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
{
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;
#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;
};
}
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");
}
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);
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)])
+
#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
#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
#endif
#ifdef AFS_LINUX22_ENV
#include "h/sched.h"
+#include "h/freezer.h"
#include "h/netdevice.h"
#include "linux/if.h"
#else