DEVEL15-linux-warning-reduction-20090318
[openafs.git] / src / afs / LINUX / osi_sleep.c
index 33b53d7..ed81e51 100644 (file)
@@ -17,6 +17,10 @@ RCSID
 #include "afsincludes.h"       /* Afs-based standard headers */
 #include "afs/afs_stats.h"     /* afs statistics */
 
+#if defined(FREEZER_H_EXISTS)
+#include <linux/freezer.h>
+#endif
+
 static int osi_TimedSleep(char *event, afs_int32 ams, int aintok);
 
 static char waitV, dummyV;
@@ -193,9 +197,27 @@ afs_osi_SleepSig(void *event)
        AFS_GUNLOCK();
        schedule();
 #ifdef AFS_LINUX26_ENV
-#ifdef CONFIG_PF
-       if (current->flags & PF_FREEZE)
+#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
 #endif
        AFS_GLOCK();
@@ -277,9 +299,27 @@ osi_TimedSleep(char *event, afs_int32 ams, int aintok)
     } else
        schedule_timeout(ticks);
 #ifdef AFS_LINUX26_ENV
-#ifdef CONFIG_PF
-    if (current->flags & PF_FREEZE)
+#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
 #endif