linux22-also-alloc-avoid-potential-recursion-freeing-memory-and-schedule-when-vmalloc...
authorNickolai Zeldovich <kolya@mit.edu>
Sun, 30 Dec 2001 00:07:02 +0000 (00:07 +0000)
committerDerrick Brashear <shadow@dementia.org>
Sun, 30 Dec 2001 00:07:02 +0000 (00:07 +0000)
linux 2.2 lacks set_current_state. currently in 2.4 it's a definition and not a real function, so this will work

src/afs/LINUX/osi_alloc.c

index 580e899..46ebc4b 100644 (file)
@@ -103,7 +103,11 @@ static void *linux_alloc(unsigned int asize)
             if (--max_wait <=0) {
                break;
             }
+#ifdef set_current_state
            set_current_state(TASK_INTERRUPTIBLE);
+#else
+           current->state = TASK_INTERRUPTIBLE;
+#endif
            schedule_timeout(HZ);
         }
        if (new) /* piggy back alloc type */