#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 */
-
-static int osi_TimedSleep(char *event, afs_int32 ams, int aintok);
+#include "osi_compat.h"
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_PF
- if (current->flags & PF_FREEZE)
- refrigerator(PF_FREEZE);
-#endif
-#endif
+ try_to_freeze();
+
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;
* from artifically increasing. */
AFS_GUNLOCK();
- if (aintok) {
- if (schedule_timeout(ticks))
+ if (schedule_timeout(ticks)) {
+ if (aintok)
code = EINTR;
- } else
- schedule_timeout(ticks);
-#ifdef AFS_LINUX26_ENV
-#ifdef CONFIG_PF
- if (current->flags & PF_FREEZE)
- refrigerator(PF_FREEZE);
-#endif
-#endif
+ }
+
+ try_to_freeze();
AFS_GLOCK();
remove_wait_queue(&evp->cond, &wait);