--- vsock-only/linux/af_vsock.c.old 2010-05-31 16:27:02.580802672 +0200 +++ vsock-only/linux/af_vsock.c 2010-05-31 16:28:36.567802987 +0200 @@ -3221,7 +3221,11 @@ * a notification of an error. */ timeout = sock_sndtimeo(sk, flags & O_NONBLOCK); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); +#else + compat_init_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); +#endif while (sk->compat_sk_state != SS_CONNECTED && sk->compat_sk_err == 0) { if (timeout == 0) { @@ -3244,7 +3248,11 @@ goto outWaitError; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) compat_cont_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); +#else + compat_cont_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); +#endif } if (sk->compat_sk_err) { @@ -3256,7 +3264,11 @@ } outWait: +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING); +#else + compat_finish_wait(sk_sleep(sk), &wait, TASK_RUNNING); +#endif out: release_sock(sk); return err; @@ -3316,7 +3328,11 @@ * upon connection establishment. */ timeout = sock_sndtimeo(listener, flags & O_NONBLOCK); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) compat_init_prepare_to_wait(listener->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); +#else + compat_init_prepare_to_wait(sk_sleep(listener), &wait, TASK_INTERRUPTIBLE); +#endif while ((connected = VSockVmciDequeueAccept(listener)) == NULL && listener->compat_sk_err == 0) { @@ -3332,7 +3348,11 @@ goto outWait; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) compat_cont_prepare_to_wait(listener->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); +#else + compat_cont_prepare_to_wait(sk_sleep(listener), &wait, TASK_INTERRUPTIBLE); +#endif } if (listener->compat_sk_err) { @@ -3366,7 +3386,11 @@ } outWait: +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) compat_finish_wait(listener->compat_sk_sleep, &wait, TASK_RUNNING); +#else + compat_finish_wait(sk_sleep(listener), &wait, TASK_RUNNING); +#endif out: release_sock(listener); return err; @@ -3464,7 +3488,11 @@ sk = sock->sk; vsk = vsock_sk(sk); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) poll_wait(file, sk->compat_sk_sleep, wait); +#else + poll_wait(file, sk_sleep(sk), wait); +#endif mask = 0; if (sk->compat_sk_err) { @@ -4104,7 +4132,11 @@ goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); +#else + compat_init_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); +#endif while (totalWritten < len) { Bool sentWrote; @@ -4141,8 +4173,13 @@ goto outWait; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) compat_cont_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); +#else + compat_cont_prepare_to_wait(sk_sleep(sk), + &wait, TASK_INTERRUPTIBLE); +#endif } /* @@ -4194,7 +4231,11 @@ if (totalWritten > 0) { err = totalWritten; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING); +#else + compat_finish_wait(sk_sleep(sk), &wait, TASK_RUNNING); +#endif out: release_sock(sk); return err; @@ -4428,7 +4469,11 @@ goto out; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); +#else + compat_init_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); +#endif while ((ready = VSockVmciStreamHasData(vsk)) < target && sk->compat_sk_err == 0 && @@ -4468,7 +4513,11 @@ goto outWait; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) compat_cont_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); +#else + compat_cont_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); +#endif } if (sk->compat_sk_err) { @@ -4534,7 +4583,11 @@ err = copied; outWait: +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING); +#else + compat_finish_wait(sk_sleep(sk), &wait, TASK_RUNNING); +#endif out: release_sock(sk); return err;