LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_SIGNAL_RLIM
LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_EXIT_STATE
LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TGID
- LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_TODO
LINUX_SCHED_STRUCT_TASK_STRUCT_HAS_THREAD_INFO
LINUX_EXPORTS_TASKLIST_LOCK
LINUX_GET_SB_HAS_STRUCT_VFSMOUNT
AC_CHECK_LINUX_HEADER([freezer.h])
LINUX_HAVE_SVC_ADDR_IN
LINUX_REFRIGERATOR
+ LINUX_HAVE_TRY_TO_FREEZE
LINUX_LINUX_KEYRING_SUPPORT
LINUX_KEY_ALLOC_NEEDS_STRUCT_TASK
LINUX_KEY_ALLOC_NEEDS_CRED
#ifndef AFS_LINUX_OSI_COMPAT_H
#define AFS_LINUX_OSI_COMPAT_H
+#if defined(HAVE_LINUX_FREEZER_H)
+# include <linux/freezer.h>
+#endif
+
#ifndef DO_SYNC_READ
static inline int
do_sync_read(struct file *fp, char *buf, size_t count, loff_t *offp) {
return ret;
}
+#endif
+#ifdef HAVE_TRY_TO_FREEZE
+static inline void
+afs_try_to_freeze() {
+# ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE
+ try_to_freeze(PF_FREEZE);
+# else
+ try_to_freeze();
+# endif
+}
+#else
+static inline void
+afs_try_to_freeze() {
+# ifdef CONFIG_PM
+ if (current->flags & PF_FREEZE) {
+ refrigerator(PF_FREEZE);
+# endif
+}
#endif
#include "afs/sysincludes.h" /* Standard vendor system headers */
#include "afsincludes.h" /* Afs-based standard headers */
#include "afs/afs_stats.h" /* afs statistics */
-#if defined(HAVE_LINUX_FREEZER_H)
-#include <linux/freezer.h>
-#endif
+#include "osi_compat.h"
static char waitV, dummyV;
AFS_ASSERT_GLOCK();
AFS_GUNLOCK();
schedule();
-#ifdef CONFIG_PM
- if (
-#ifdef PF_FREEZE
- current->flags & PF_FREEZE
-#else
-#if defined(STRUCT_TASK_STRUCT_HAS_TODO)
- !current->todo
-#else
-#if defined(STRUCT_TASK_STRUCT_HAS_THREAD_INFO)
- test_ti_thread_flag(current->thread_info, TIF_FREEZE)
-#else
- test_ti_thread_flag(task_thread_info(current), TIF_FREEZE)
-#endif
-#endif
-#endif
- )
-#ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE
- refrigerator(PF_FREEZE);
-#else
- refrigerator();
-#endif
-#endif
+ try_to_freeze();
+
AFS_GLOCK();
if (signal_pending(current)) {
retval = EINTR;
* from artifically increasing. */
AFS_GUNLOCK();
- if (aintok) {
- if (schedule_timeout(ticks))
+ if (schedule_timeout(ticks)) {
+ if (aintok)
code = EINTR;
- } else
- schedule_timeout(ticks);
-#ifdef CONFIG_PM
- if (
-#ifdef PF_FREEZE
- current->flags & PF_FREEZE
-#else
-#if defined(STRUCT_TASK_STRUCT_HAS_TODO)
- !current->todo
-#else
-#if defined(STRUCT_TASK_STRUCT_HAS_THREAD_INFO)
- test_ti_thread_flag(current->thread_info, TIF_FREEZE)
-#else
- test_ti_thread_flag(task_thread_info(current), TIF_FREEZE)
-#endif
-#endif
-#endif
- )
-#ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE
- refrigerator(PF_FREEZE);
-#else
- refrigerator();
-#endif
-#endif
+ }
+
+ try_to_freeze();
AFS_GLOCK();
remove_wait_queue(&evp->cond, &wait);
[refrigerator(PF_FREEZE);],
ac_cv_linux_func_refrigerator_takes_pf_freeze=yes,
ac_cv_linux_func_refrigerator_takes_pf_freeze=no)])
- AC_MSG_RESULT($ac_cv_linux_func_refrigerator_takes_pf_freeze)])
-
+ AC_MSG_RESULT($ac_cv_linux_func_refrigerator_takes_pf_freeze)
+ if test "x$ac_cv_linux_func_refrigerator_takes_pf_freeze" = "xyes"; then
+ AC_DEFINE([LINUX_REFRIGERATOR_TAKES_PF_FREEZE], 1, [define if your refrigerator takes PF_FREEZE])
+ fi])
AC_DEFUN([LINUX_IOP_I_CREATE_TAKES_NAMEIDATA], [
AC_MSG_CHECKING([whether inode_operations.create takes a nameidata])
AC_DEFINE([HAVE_LINUX_D_ALLOC_ANON], 1, [define if your kernel has d_alloc_anon()])
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_MSG_RESULT($ac_cv_linux_have_kernel_setsockopt)
if test "x$ac_cv_linux_have_kernel_setsockopt" = "xyes"; then
AC_DEFINE([HAVE_KERNEL_SETSOCKOPT], 1, [define if your kernel has the kernel_setsockopt function])
+
+AC_DEFUN([LINUX_HAVE_TRY_TO_FREEZE], [
+ AC_MSG_CHECKING([for try_to_freeze])
+ AC_CACHE_VAL([ac_cv_linux_have_try_to_freeze], [
+ AC_TRY_KBUILD(
+[#include <linux/sched.h>
+#ifdef FREEZER_H_EXISTS
+#include <linux/freezer.h>
+#endif],
+[#ifdef LINUX_REFRIGERATOR_TAKES_PF_FREEZE
+ try_to_freeze(PF_FREEZE);
+#else
+ try_to_freeze();
+#endif
+],
+ ac_cv_linux_have_try_to_freeze=yes,
+ ac_cv_linux_have_try_to_freeze=no)])
+ AC_MSG_RESULT($ac_cv_linux_have_try_to_freeze)
+ if test "x$ac_cv_linux_have_try_to_freeze" = "xyes"; then
+ AC_DEFINE([HAVE_TRY_TO_FREEZE], 1, [define if your kernel has the try_to_freeze function])
fi])