You can import this changeset into BK by piping this whole message to: '| bk receive [path to repository]' or apply the patch as usual. =================================================================== ChangeSet@1.1421.1.4, 2003-11-11 00:28:04-02:00, acme@conectiva.com.br o BLUETOOTH: use sk_wait_event primitive af_bluetooth.c | 8 +++----- l2cap.c | 10 +++++----- rfcomm/sock.c | 23 +++++++++++------------ sco.c | 10 +++++----- 4 files changed, 24 insertions(+), 27 deletions(-) diff -Nru a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c --- a/net/bluetooth/af_bluetooth.c Sat Nov 15 17:02:49 2003 +++ b/net/bluetooth/af_bluetooth.c Sat Nov 15 17:02:49 2003 @@ -278,8 +278,10 @@ BT_DBG("sk %p", sk); add_wait_queue(sk->sk_sleep, &wait); - while (sk->sk_state != state) { + while (1) { set_current_state(TASK_INTERRUPTIBLE); + if (sk_wait_event(sk, &timeo, sk->sk_state == state)) + break; if (!timeo) { err = -EAGAIN; @@ -290,10 +292,6 @@ err = sock_intr_errno(timeo); break; } - - release_sock(sk); - timeo = schedule_timeout(timeo); - lock_sock(sk); if (sk->sk_err) { err = sock_error(sk); diff -Nru a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c --- a/net/bluetooth/l2cap.c Sat Nov 15 17:02:49 2003 +++ b/net/bluetooth/l2cap.c Sat Nov 15 17:02:49 2003 @@ -583,16 +583,16 @@ /* Wait for an incoming connection. (wake-one). */ add_wait_queue_exclusive(sk->sk_sleep, &wait); - while (!(nsk = bt_accept_dequeue(sk, newsock))) { + while (1) { set_current_state(TASK_INTERRUPTIBLE); + if (sk_wait_event(sk, &timeo, + (nsk = bt_accept_dequeue(sk, newsock)) != NULL)) + break; + if (!timeo) { err = -EAGAIN; break; } - - release_sock(sk); - timeo = schedule_timeout(timeo); - lock_sock(sk); if (sk->sk_state != BT_LISTEN) { err = -EBADFD; diff -Nru a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c --- a/net/bluetooth/rfcomm/sock.c Sat Nov 15 17:02:49 2003 +++ b/net/bluetooth/rfcomm/sock.c Sat Nov 15 17:02:49 2003 @@ -427,17 +427,16 @@ /* Wait for an incoming connection. (wake-one). */ add_wait_queue_exclusive(sk->sk_sleep, &wait); - while (!(nsk = bt_accept_dequeue(sk, newsock))) { + while (1) { set_current_state(TASK_INTERRUPTIBLE); + if (sk_wait_event(sk, &timeo, + (nsk = bt_accept_dequeue(sk, newsock)) != NULL)) + break; if (!timeo) { err = -EAGAIN; break; } - release_sock(sk); - timeo = schedule_timeout(timeo); - lock_sock(sk); - if (sk->sk_state != BT_LISTEN) { err = -EBADFD; break; @@ -539,14 +538,14 @@ for (;;) { set_current_state(TASK_INTERRUPTIBLE); - if (skb_queue_len(&sk->sk_receive_queue) || sk->sk_err || (sk->sk_shutdown & RCV_SHUTDOWN) || - signal_pending(current) || !timeo) - break; - set_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags); - release_sock(sk); - timeo = schedule_timeout(timeo); - lock_sock(sk); + if (sk_wait_event(sk, &timeo, + skb_queue_len(&sk->sk_receive_queue) || + sk->sk_err || + (sk->sk_shutdown & RCV_SHUTDOWN))) + break; + if (signal_pending(current) || !timeo) + break; clear_bit(SOCK_ASYNC_WAITDATA, &sk->sk_socket->flags); } diff -Nru a/net/bluetooth/sco.c b/net/bluetooth/sco.c --- a/net/bluetooth/sco.c Sat Nov 15 17:02:49 2003 +++ b/net/bluetooth/sco.c Sat Nov 15 17:02:49 2003 @@ -576,16 +576,16 @@ /* Wait for an incoming connection. (wake-one). */ add_wait_queue_exclusive(sk->sk_sleep, &wait); - while (!(ch = bt_accept_dequeue(sk, newsock))) { + while (1) { set_current_state(TASK_INTERRUPTIBLE); + if (sk_wait_event(sk, &timeo, + (ch = bt_accept_dequeue(sk, newsock)) != NULL)) + break; + if (!timeo) { err = -EAGAIN; break; } - - release_sock(sk); - timeo = schedule_timeout(timeo); - lock_sock(sk); if (sk->sk_state != BT_LISTEN) { err = -EBADFD; =================================================================== This BitKeeper patch contains the following changesets: 1.1421.1.4 ## Wrapped with gzip_uu ## M'XL( %EXMC\ \U7:V_:2!3]S/R*J2I%H"UFGGZPHLHVJ9JJ41.E8??#[LH: MCR?! FQJ&]A5_>/WVCR" TT 9=4:X\'SN'/FSKGG#J]Q/S-IMZ'TV*#7^"+) M\FY#)['1>313ED[&5I!"PTV20$-GD(Q-I^S;"8:L$YN\S2S;H@AZ7*M<#_#, MI%FW02V^KLG_G9ANX^;]A_[E;S<(]7KX;*#B>_/%Y+C70WF2SM0HS$Y5/A@E ML96G*L[&)J_F+M9="T8(@X^D#B?2+JA-A%-H&E*J!#4A8<*U!2JAG3Z&7[?" M*5R$,5NX!:%<,G2.J44%@XL(%G&/US_#TZU2-P,9X![Q,)RM4DG#&*"%V MP9G@=A%H171XQXPV4M[I[^SK]^QM@K&I*\0A3ALQK2:^3E*SPV6N@&?@:"]P MN H(YUHQ9R]PE=EM>$!LFZ]\-8LF)K6:,5AJ/1J>WI5.[&2)'BYA@;<(?WM\6)1QF50DA1 MV()PMU(&QNN:X'2E_;0F2-R6/UH3%NR\PNUT7MT0Y->[G'V$5IQ+Q\,4?5P4 MC?D@&AGI<@@5J-*([W*R!@[W[UQ^=6#? 25'0? MJY$_,7$8Q?=-/4U30%?.@U]5Z#:'; =//?>6T?._G@>0&D[&ITD6CJPDO?]S MQ>F_]S@10!:ALOP6$%..>V0X\9] IACJ>Z 8\*)N;0,IT51#R?F,LR> MX_2*GUFN<@.\P-6/>L0PC^]4Y.7IY" V'7Y0>E:3-P])&VK,'>!/11]^,'U^ MABR_..0]29_ERH_*\ZY=Y?FJ>)SGG7WS_/$R7"9ZKU3@]7])/3!ZF$W'/1MR .L_"D0/\!ZK;9N\ .