#include <afsconfig.h>
#include "afs/param.h"
-RCSID
- ("$Header$");
#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>
-
-static int osi_TimedSleep(char *event, afs_int32 ams, int aintok);
+#endif
static char waitV, dummyV;
do {
AFS_ASSERT_GLOCK();
- code = osi_TimedSleep(&waitV, ams, 1);
+ code = afs_osi_TimedSleep(&waitV, ams, 1);
if (code)
break;
if (ahandle && (ahandle->proc == (caddr_t) 0)) {
int seq; /* Sequence number: this is incremented
* by wakeup calls; wait will not return until
* it changes */
-#if defined(AFS_LINUX24_ENV)
wait_queue_head_t cond;
-#else
- struct wait_queue *cond;
-#endif
} afs_event_t;
#define HASHSIZE 128
afs_evhashcnt++;
newp->next = afs_evhasht[hashcode];
afs_evhasht[hashcode] = newp;
-#if defined(AFS_LINUX24_ENV)
init_waitqueue_head(&newp->cond);
-#else
- init_waitqueue(&newp->cond);
-#endif
newp->seq = 0;
newp->event = &dummyV; /* Dummy address for new events */
newp->refcount = 0;
AFS_ASSERT_GLOCK();
AFS_GUNLOCK();
schedule();
-#ifdef AFS_LINUX26_ENV
#ifdef CONFIG_PM
if (
#ifdef PF_FREEZE
#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
)
refrigerator();
#endif
#endif
-#endif
AFS_GLOCK();
if (signal_pending(current)) {
retval = EINTR;
SIG_UNLOCK(current);
}
-/* osi_TimedSleep
+/* afs_osi_TimedSleep
*
* Arguments:
* event - event to sleep on
* Returns 0 if timeout, EINTR if signalled, and EGAIN if it might
* have raced.
*/
-static int
-osi_TimedSleep(char *event, afs_int32 ams, int aintok)
+int
+afs_osi_TimedSleep(void *event, afs_int32 ams, int aintok)
{
int code = 0;
long ticks = (ams * HZ / 1000) + 1;
code = EINTR;
} else
schedule_timeout(ticks);
-#ifdef AFS_LINUX26_ENV
#ifdef CONFIG_PM
if (
#ifdef PF_FREEZE
#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
)
refrigerator();
#endif
#endif
-#endif
AFS_GLOCK();
remove_wait_queue(&evp->cond, &wait);