Lines 3221-3227
Link Here
|
3221 |
* a notification of an error. |
3221 |
* a notification of an error. |
3222 |
*/ |
3222 |
*/ |
3223 |
timeout = sock_sndtimeo(sk, flags & O_NONBLOCK); |
3223 |
timeout = sock_sndtimeo(sk, flags & O_NONBLOCK); |
|
|
3224 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) |
3224 |
compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); |
3225 |
compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); |
|
|
3226 |
#else |
3227 |
compat_init_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); |
3228 |
#endif |
3225 |
|
3229 |
|
3226 |
while (sk->compat_sk_state != SS_CONNECTED && sk->compat_sk_err == 0) { |
3230 |
while (sk->compat_sk_state != SS_CONNECTED && sk->compat_sk_err == 0) { |
3227 |
if (timeout == 0) { |
3231 |
if (timeout == 0) { |
Lines 3244-3250
Link Here
|
3244 |
goto outWaitError; |
3248 |
goto outWaitError; |
3245 |
} |
3249 |
} |
3246 |
|
3250 |
|
|
|
3251 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) |
3247 |
compat_cont_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); |
3252 |
compat_cont_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); |
|
|
3253 |
#else |
3254 |
compat_cont_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); |
3255 |
#endif |
3248 |
} |
3256 |
} |
3249 |
|
3257 |
|
3250 |
if (sk->compat_sk_err) { |
3258 |
if (sk->compat_sk_err) { |
Lines 3256-3262
Link Here
|
3256 |
} |
3264 |
} |
3257 |
|
3265 |
|
3258 |
outWait: |
3266 |
outWait: |
|
|
3267 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) |
3259 |
compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING); |
3268 |
compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING); |
|
|
3269 |
#else |
3270 |
compat_finish_wait(sk_sleep(sk), &wait, TASK_RUNNING); |
3271 |
#endif |
3260 |
out: |
3272 |
out: |
3261 |
release_sock(sk); |
3273 |
release_sock(sk); |
3262 |
return err; |
3274 |
return err; |
Lines 3316-3322
Link Here
|
3316 |
* upon connection establishment. |
3328 |
* upon connection establishment. |
3317 |
*/ |
3329 |
*/ |
3318 |
timeout = sock_sndtimeo(listener, flags & O_NONBLOCK); |
3330 |
timeout = sock_sndtimeo(listener, flags & O_NONBLOCK); |
|
|
3331 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) |
3319 |
compat_init_prepare_to_wait(listener->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); |
3332 |
compat_init_prepare_to_wait(listener->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); |
|
|
3333 |
#else |
3334 |
compat_init_prepare_to_wait(sk_sleep(listener), &wait, TASK_INTERRUPTIBLE); |
3335 |
#endif |
3320 |
|
3336 |
|
3321 |
while ((connected = VSockVmciDequeueAccept(listener)) == NULL && |
3337 |
while ((connected = VSockVmciDequeueAccept(listener)) == NULL && |
3322 |
listener->compat_sk_err == 0) { |
3338 |
listener->compat_sk_err == 0) { |
Lines 3332-3338
Link Here
|
3332 |
goto outWait; |
3348 |
goto outWait; |
3333 |
} |
3349 |
} |
3334 |
|
3350 |
|
|
|
3351 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) |
3335 |
compat_cont_prepare_to_wait(listener->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); |
3352 |
compat_cont_prepare_to_wait(listener->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); |
|
|
3353 |
#else |
3354 |
compat_cont_prepare_to_wait(sk_sleep(listener), &wait, TASK_INTERRUPTIBLE); |
3355 |
#endif |
3336 |
} |
3356 |
} |
3337 |
|
3357 |
|
3338 |
if (listener->compat_sk_err) { |
3358 |
if (listener->compat_sk_err) { |
Lines 3366-3372
Link Here
|
3366 |
} |
3386 |
} |
3367 |
|
3387 |
|
3368 |
outWait: |
3388 |
outWait: |
|
|
3389 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) |
3369 |
compat_finish_wait(listener->compat_sk_sleep, &wait, TASK_RUNNING); |
3390 |
compat_finish_wait(listener->compat_sk_sleep, &wait, TASK_RUNNING); |
|
|
3391 |
#else |
3392 |
compat_finish_wait(sk_sleep(listener), &wait, TASK_RUNNING); |
3393 |
#endif |
3370 |
out: |
3394 |
out: |
3371 |
release_sock(listener); |
3395 |
release_sock(listener); |
3372 |
return err; |
3396 |
return err; |
Lines 3464-3470
Link Here
|
3464 |
sk = sock->sk; |
3488 |
sk = sock->sk; |
3465 |
vsk = vsock_sk(sk); |
3489 |
vsk = vsock_sk(sk); |
3466 |
|
3490 |
|
|
|
3491 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) |
3467 |
poll_wait(file, sk->compat_sk_sleep, wait); |
3492 |
poll_wait(file, sk->compat_sk_sleep, wait); |
|
|
3493 |
#else |
3494 |
poll_wait(file, sk_sleep(sk), wait); |
3495 |
#endif |
3468 |
mask = 0; |
3496 |
mask = 0; |
3469 |
|
3497 |
|
3470 |
if (sk->compat_sk_err) { |
3498 |
if (sk->compat_sk_err) { |
Lines 4104-4110
Link Here
|
4104 |
goto out; |
4132 |
goto out; |
4105 |
} |
4133 |
} |
4106 |
|
4134 |
|
|
|
4135 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) |
4107 |
compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); |
4136 |
compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); |
|
|
4137 |
#else |
4138 |
compat_init_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); |
4139 |
#endif |
4108 |
|
4140 |
|
4109 |
while (totalWritten < len) { |
4141 |
while (totalWritten < len) { |
4110 |
Bool sentWrote; |
4142 |
Bool sentWrote; |
Lines 4141-4148
Link Here
|
4141 |
goto outWait; |
4173 |
goto outWait; |
4142 |
} |
4174 |
} |
4143 |
|
4175 |
|
|
|
4176 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) |
4144 |
compat_cont_prepare_to_wait(sk->compat_sk_sleep, |
4177 |
compat_cont_prepare_to_wait(sk->compat_sk_sleep, |
4145 |
&wait, TASK_INTERRUPTIBLE); |
4178 |
&wait, TASK_INTERRUPTIBLE); |
|
|
4179 |
#else |
4180 |
compat_cont_prepare_to_wait(sk_sleep(sk), |
4181 |
&wait, TASK_INTERRUPTIBLE); |
4182 |
#endif |
4146 |
} |
4183 |
} |
4147 |
|
4184 |
|
4148 |
/* |
4185 |
/* |
Lines 4194-4200
Link Here
|
4194 |
if (totalWritten > 0) { |
4231 |
if (totalWritten > 0) { |
4195 |
err = totalWritten; |
4232 |
err = totalWritten; |
4196 |
} |
4233 |
} |
|
|
4234 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) |
4197 |
compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING); |
4235 |
compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING); |
|
|
4236 |
#else |
4237 |
compat_finish_wait(sk_sleep(sk), &wait, TASK_RUNNING); |
4238 |
#endif |
4198 |
out: |
4239 |
out: |
4199 |
release_sock(sk); |
4240 |
release_sock(sk); |
4200 |
return err; |
4241 |
return err; |
Lines 4428-4434
Link Here
|
4428 |
goto out; |
4469 |
goto out; |
4429 |
} |
4470 |
} |
4430 |
|
4471 |
|
|
|
4472 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) |
4431 |
compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); |
4473 |
compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); |
|
|
4474 |
#else |
4475 |
compat_init_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); |
4476 |
#endif |
4432 |
|
4477 |
|
4433 |
while ((ready = VSockVmciStreamHasData(vsk)) < target && |
4478 |
while ((ready = VSockVmciStreamHasData(vsk)) < target && |
4434 |
sk->compat_sk_err == 0 && |
4479 |
sk->compat_sk_err == 0 && |
Lines 4468-4474
Link Here
|
4468 |
goto outWait; |
4513 |
goto outWait; |
4469 |
} |
4514 |
} |
4470 |
|
4515 |
|
|
|
4516 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) |
4471 |
compat_cont_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); |
4517 |
compat_cont_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); |
|
|
4518 |
#else |
4519 |
compat_cont_prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); |
4520 |
#endif |
4472 |
} |
4521 |
} |
4473 |
|
4522 |
|
4474 |
if (sk->compat_sk_err) { |
4523 |
if (sk->compat_sk_err) { |
Lines 4534-4540
Link Here
|
4534 |
err = copied; |
4583 |
err = copied; |
4535 |
|
4584 |
|
4536 |
outWait: |
4585 |
outWait: |
|
|
4586 |
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 34) |
4537 |
compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING); |
4587 |
compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING); |
|
|
4588 |
#else |
4589 |
compat_finish_wait(sk_sleep(sk), &wait, TASK_RUNNING); |
4590 |
#endif |
4538 |
out: |
4591 |
out: |
4539 |
release_sock(sk); |
4592 |
release_sock(sk); |
4540 |
return err; |
4593 |
return err; |