Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 322245 | Differences between
and this patch

Collapse All | Expand All

(-)vsock-only/linux/af_vsock.c (+53 lines)
Lines 3149-3155 Link Here
3149
    * a notification of an error.
3149
    * a notification of an error.
3150
    */
3150
    */
3151
   timeout = sock_sndtimeo(sk, flags & O_NONBLOCK);
3151
   timeout = sock_sndtimeo(sk, flags & O_NONBLOCK);
3152
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
3152
   compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
3153
   compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
3154
#else
3155
   compat_init_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
3156
#endif
3153
3157
3154
   while (sk->compat_sk_state != SS_CONNECTED && sk->compat_sk_err == 0) {
3158
   while (sk->compat_sk_state != SS_CONNECTED && sk->compat_sk_err == 0) {
3155
      if (timeout == 0) {
3159
      if (timeout == 0) {
Lines 3172-3178 Link Here
3172
         goto outWaitError;
3176
         goto outWaitError;
3173
      }
3177
      }
3174
3178
3179
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
3175
      compat_cont_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
3180
      compat_cont_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
3181
#else
3182
      compat_cont_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
3183
#endif
3176
   }
3184
   }
3177
3185
3178
   if (sk->compat_sk_err) {
3186
   if (sk->compat_sk_err) {
Lines 3184-3190 Link Here
3184
   }
3192
   }
3185
3193
3186
outWait:
3194
outWait:
3195
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
3187
   compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING);
3196
   compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING);
3197
#else
3198
   compat_finish_wait(sk_sleep(sk), &wait, TASK_RUNNING);
3199
#endif
3188
out:
3200
out:
3189
   release_sock(sk);
3201
   release_sock(sk);
3190
   return err;
3202
   return err;
Lines 3244-3250 Link Here
3244
    * upon connection establishment.
3256
    * upon connection establishment.
3245
    */
3257
    */
3246
   timeout = sock_sndtimeo(listener, flags & O_NONBLOCK);
3258
   timeout = sock_sndtimeo(listener, flags & O_NONBLOCK);
3259
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
3247
   compat_init_prepare_to_wait(listener->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
3260
   compat_init_prepare_to_wait(listener->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
3261
#else
3262
   compat_init_prepare_to_wait(sk_sleep(listener), &wait, TASK_INTERRUPTIBLE);
3263
#endif
3248
3264
3249
   while ((connected = VSockVmciDequeueAccept(listener)) == NULL &&
3265
   while ((connected = VSockVmciDequeueAccept(listener)) == NULL &&
3250
          listener->compat_sk_err == 0) {
3266
          listener->compat_sk_err == 0) {
Lines 3260-3266 Link Here
3260
         goto outWait;
3276
         goto outWait;
3261
      }
3277
      }
3262
3278
3279
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
3263
      compat_cont_prepare_to_wait(listener->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
3280
      compat_cont_prepare_to_wait(listener->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
3281
#else
3282
      compat_cont_prepare_to_wait(sk_sleep(listener), &wait, TASK_INTERRUPTIBLE);
3283
#endif
3264
   }
3284
   }
3265
3285
3266
   if (listener->compat_sk_err) {
3286
   if (listener->compat_sk_err) {
Lines 3294-3300 Link Here
3294
   }
3314
   }
3295
3315
3296
outWait:
3316
outWait:
3317
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
3297
   compat_finish_wait(listener->compat_sk_sleep, &wait, TASK_RUNNING);
3318
   compat_finish_wait(listener->compat_sk_sleep, &wait, TASK_RUNNING);
3319
#else
3320
   compat_finish_wait(sk_sleep(listener), &wait, TASK_RUNNING);
3321
#endif
3298
out:
3322
out:
3299
   release_sock(listener);
3323
   release_sock(listener);
3300
   return err;
3324
   return err;
Lines 3391-3397 Link Here
3391
3415
3392
   sk = sock->sk;
3416
   sk = sock->sk;
3393
3417
3418
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
3394
   poll_wait(file, sk->compat_sk_sleep, wait);
3419
   poll_wait(file, sk->compat_sk_sleep, wait);
3420
#else
3421
   poll_wait(file, sk_sleep(sk), wait);
3422
#endif
3395
   mask = 0;
3423
   mask = 0;
3396
3424
3397
   if (sk->compat_sk_err) {
3425
   if (sk->compat_sk_err) {
Lines 3992-3998 Link Here
3992
    * Wait for room in the produce queue to enqueue our user's data.
4020
    * Wait for room in the produce queue to enqueue our user's data.
3993
    */
4021
    */
3994
   timeout = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT);
4022
   timeout = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT);
4023
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
3995
   compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
4024
   compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
4025
#else
4026
   compat_init_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
4027
#endif
3996
4028
3997
   while (totalWritten < len) {
4029
   while (totalWritten < len) {
3998
      Bool sentWrote;
4030
      Bool sentWrote;
Lines 4031-4038 Link Here
4031
            goto outWait;
4063
            goto outWait;
4032
         }
4064
         }
4033
4065
4066
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
4034
         compat_cont_prepare_to_wait(sk->compat_sk_sleep,
4067
         compat_cont_prepare_to_wait(sk->compat_sk_sleep,
4035
                                     &wait, TASK_INTERRUPTIBLE);
4068
                                     &wait, TASK_INTERRUPTIBLE);
4069
#else
4070
         compat_cont_prepare_to_wait(sk_sleep(sk),
4071
                                     &wait, TASK_INTERRUPTIBLE);
4072
#endif
4036
      }
4073
      }
4037
4074
4038
      /*
4075
      /*
Lines 4114-4120 Link Here
4114
   if (totalWritten > 0) {
4151
   if (totalWritten > 0) {
4115
      err = totalWritten;
4152
      err = totalWritten;
4116
   }
4153
   }
4154
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
4117
   compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING);
4155
   compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING);
4156
#else
4157
   compat_finish_wait(sk_sleep(sk), &wait, TASK_RUNNING);
4158
#endif
4118
out:
4159
out:
4119
   release_sock(sk);
4160
   release_sock(sk);
4120
   return err;
4161
   return err;
Lines 4337-4343 Link Here
4337
   timeout = sock_rcvtimeo(sk, flags & MSG_DONTWAIT);
4378
   timeout = sock_rcvtimeo(sk, flags & MSG_DONTWAIT);
4338
   copied = 0;
4379
   copied = 0;
4339
4380
4381
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
4340
   compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
4382
   compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
4383
#else
4384
   compat_init_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
4385
#endif
4341
4386
4342
   while ((ready = VMCIQueue_BufReady(vsk->consumeQ,
4387
   while ((ready = VMCIQueue_BufReady(vsk->consumeQ,
4343
                                      vsk->produceQ,
4388
                                      vsk->produceQ,
Lines 4380-4386 Link Here
4380
         goto outWait;
4425
         goto outWait;
4381
      }
4426
      }
4382
4427
4428
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
4383
      compat_cont_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
4429
      compat_cont_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE);
4430
#else
4431
      compat_cont_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
4432
#endif
4384
   }
4433
   }
4385
4434
4386
   if (sk->compat_sk_err) {
4435
   if (sk->compat_sk_err) {
Lines 4472-4478 Link Here
4472
   err = copied;
4521
   err = copied;
4473
4522
4474
outWait:
4523
outWait:
4524
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34)
4475
   compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING);
4525
   compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING);
4526
#else
4527
   compat_finish_wait(sk_sleep(sk), &wait, TASK_RUNNING);
4528
#endif
4476
out:
4529
out:
4477
   release_sock(sk);
4530
   release_sock(sk);
4478
   return err;
4531
   return err;

Return to bug 322245