Commit 072a9d39 authored by Chas Williams's avatar Chas Williams Committed by Hideaki Yoshifuji

[ATM]: Eliminate vcc->sleep in favor of sk->sk_sleep.

parent 999fdfc4
...@@ -66,7 +66,7 @@ static int atmtcp_send_control(struct atm_vcc *vcc,int type, ...@@ -66,7 +66,7 @@ static int atmtcp_send_control(struct atm_vcc *vcc,int type,
*(struct atm_vcc **) &new_msg->vcc = vcc; *(struct atm_vcc **) &new_msg->vcc = vcc;
old_test = test_bit(flag,&vcc->flags); old_test = test_bit(flag,&vcc->flags);
out_vcc->push(out_vcc,skb); out_vcc->push(out_vcc,skb);
add_wait_queue(&vcc->sleep,&wait); add_wait_queue(vcc->sk->sk_sleep, &wait);
while (test_bit(flag,&vcc->flags) == old_test) { while (test_bit(flag,&vcc->flags) == old_test) {
mb(); mb();
out_vcc = PRIV(vcc->dev) ? PRIV(vcc->dev)->vcc : NULL; out_vcc = PRIV(vcc->dev) ? PRIV(vcc->dev)->vcc : NULL;
...@@ -78,7 +78,7 @@ static int atmtcp_send_control(struct atm_vcc *vcc,int type, ...@@ -78,7 +78,7 @@ static int atmtcp_send_control(struct atm_vcc *vcc,int type,
schedule(); schedule();
} }
current->state = TASK_RUNNING; current->state = TASK_RUNNING;
remove_wait_queue(&vcc->sleep,&wait); remove_wait_queue(vcc->sk->sk_sleep, &wait);
return error; return error;
} }
...@@ -103,7 +103,7 @@ static int atmtcp_recv_control(const struct atmtcp_control *msg) ...@@ -103,7 +103,7 @@ static int atmtcp_recv_control(const struct atmtcp_control *msg)
msg->type); msg->type);
return -EINVAL; return -EINVAL;
} }
wake_up(&vcc->sleep); wake_up(vcc->sk->sk_sleep);
return 0; return 0;
} }
...@@ -257,7 +257,7 @@ static void atmtcp_c_close(struct atm_vcc *vcc) ...@@ -257,7 +257,7 @@ static void atmtcp_c_close(struct atm_vcc *vcc)
walk = atm_sk(s); walk = atm_sk(s);
if (walk->dev != atmtcp_dev) if (walk->dev != atmtcp_dev)
continue; continue;
wake_up(&walk->sleep); wake_up(walk->sk->sk_sleep);
} }
read_unlock(&vcc_sklist_lock); read_unlock(&vcc_sklist_lock);
} }
......
...@@ -291,7 +291,6 @@ struct atm_vcc { ...@@ -291,7 +291,6 @@ struct atm_vcc {
void *dev_data; /* per-device data */ void *dev_data; /* per-device data */
void *proto_data; /* per-protocol data */ void *proto_data; /* per-protocol data */
struct k_atm_aal_stats *stats; /* pointer to AAL stats group */ struct k_atm_aal_stats *stats; /* pointer to AAL stats group */
wait_queue_head_t sleep; /* if socket is busy */
struct sock *sk; /* socket backpointer */ struct sock *sk; /* socket backpointer */
/* SVC part --- may move later ------------------------------------- */ /* SVC part --- may move later ------------------------------------- */
short itf; /* interface number */ short itf; /* interface number */
......
...@@ -67,7 +67,7 @@ static int to_atmarpd(enum atmarp_ctrl_type type,int itf,unsigned long ip) ...@@ -67,7 +67,7 @@ static int to_atmarpd(enum atmarp_ctrl_type type,int itf,unsigned long ip)
ctrl->ip = ip; ctrl->ip = ip;
atm_force_charge(atmarpd,skb->truesize); atm_force_charge(atmarpd,skb->truesize);
skb_queue_tail(&atmarpd->sk->sk_receive_queue, skb); skb_queue_tail(&atmarpd->sk->sk_receive_queue, skb);
wake_up(&atmarpd->sleep); wake_up(atmarpd->sk->sk_sleep);
return 0; return 0;
} }
......
...@@ -255,7 +255,7 @@ int vcc_create(struct socket *sock, int protocol, int family) ...@@ -255,7 +255,7 @@ int vcc_create(struct socket *sock, int protocol, int family)
sk = sk_alloc(family, GFP_KERNEL, 1, NULL); sk = sk_alloc(family, GFP_KERNEL, 1, NULL);
if (!sk) if (!sk)
return -ENOMEM; return -ENOMEM;
sock_init_data(NULL, sk); sock_init_data(sock, sk);
sk->sk_state_change = vcc_def_wakeup; sk->sk_state_change = vcc_def_wakeup;
vcc = atm_sk(sk) = kmalloc(sizeof(*vcc), GFP_KERNEL); vcc = atm_sk(sk) = kmalloc(sizeof(*vcc), GFP_KERNEL);
...@@ -277,8 +277,6 @@ int vcc_create(struct socket *sock, int protocol, int family) ...@@ -277,8 +277,6 @@ int vcc_create(struct socket *sock, int protocol, int family)
vcc->push_oam = NULL; vcc->push_oam = NULL;
vcc->vpi = vcc->vci = 0; /* no VCI/VPI yet */ vcc->vpi = vcc->vci = 0; /* no VCI/VPI yet */
vcc->atm_options = vcc->aal_options = 0; vcc->atm_options = vcc->aal_options = 0;
init_waitqueue_head(&vcc->sleep);
sk->sk_sleep = &vcc->sleep;
sk->sk_destruct = vcc_sock_destruct; sk->sk_destruct = vcc_sock_destruct;
sock->sk = sk; sock->sk = sk;
return 0; return 0;
...@@ -330,7 +328,7 @@ void vcc_release_async(struct atm_vcc *vcc, int reply) ...@@ -330,7 +328,7 @@ void vcc_release_async(struct atm_vcc *vcc, int reply)
set_bit(ATM_VF_CLOSE, &vcc->flags); set_bit(ATM_VF_CLOSE, &vcc->flags);
vcc->reply = reply; vcc->reply = reply;
vcc->sk->sk_err = -reply; vcc->sk->sk_err = -reply;
wake_up(&vcc->sleep); wake_up(vcc->sk->sk_sleep);
} }
...@@ -577,7 +575,7 @@ int vcc_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m, ...@@ -577,7 +575,7 @@ int vcc_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
} }
/* verify_area is done by net/socket.c */ /* verify_area is done by net/socket.c */
eff = (size+3) & ~3; /* align to word boundary */ eff = (size+3) & ~3; /* align to word boundary */
prepare_to_wait(&vcc->sleep, &wait, TASK_INTERRUPTIBLE); prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
error = 0; error = 0;
while (!(skb = alloc_tx(vcc,eff))) { while (!(skb = alloc_tx(vcc,eff))) {
if (m->msg_flags & MSG_DONTWAIT) { if (m->msg_flags & MSG_DONTWAIT) {
...@@ -598,9 +596,9 @@ int vcc_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m, ...@@ -598,9 +596,9 @@ int vcc_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *m,
error = -EPIPE; error = -EPIPE;
break; break;
} }
prepare_to_wait(&vcc->sleep, &wait, TASK_INTERRUPTIBLE); prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
} }
finish_wait(&vcc->sleep, &wait); finish_wait(sk->sk_sleep, &wait);
if (error) if (error)
goto out; goto out;
skb->dev = NULL; /* for paths shared with net_device interfaces */ skb->dev = NULL; /* for paths shared with net_device interfaces */
...@@ -625,7 +623,7 @@ unsigned int atm_poll(struct file *file,struct socket *sock,poll_table *wait) ...@@ -625,7 +623,7 @@ unsigned int atm_poll(struct file *file,struct socket *sock,poll_table *wait)
unsigned int mask; unsigned int mask;
vcc = ATM_SD(sock); vcc = ATM_SD(sock);
poll_wait(file,&vcc->sleep,wait); poll_wait(file, vcc->sk->sk_sleep, wait);
mask = 0; mask = 0;
if (skb_peek(&vcc->sk->sk_receive_queue)) if (skb_peek(&vcc->sk->sk_receive_queue))
mask |= POLLIN | POLLRDNORM; mask |= POLLIN | POLLRDNORM;
......
...@@ -134,7 +134,7 @@ static void lec_handle_bridge(struct sk_buff *skb, struct net_device *dev) ...@@ -134,7 +134,7 @@ static void lec_handle_bridge(struct sk_buff *skb, struct net_device *dev)
priv = (struct lec_priv *)dev->priv; priv = (struct lec_priv *)dev->priv;
atm_force_charge(priv->lecd, skb2->truesize); atm_force_charge(priv->lecd, skb2->truesize);
skb_queue_tail(&priv->lecd->sk->sk_receive_queue, skb2); skb_queue_tail(&priv->lecd->sk->sk_receive_queue, skb2);
wake_up(&priv->lecd->sleep); wake_up(priv->lecd->sk->sk_sleep);
} }
return; return;
...@@ -513,7 +513,7 @@ lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb) ...@@ -513,7 +513,7 @@ lec_atm_send(struct atm_vcc *vcc, struct sk_buff *skb)
memcpy(skb2->data, mesg, sizeof(struct atmlec_msg)); memcpy(skb2->data, mesg, sizeof(struct atmlec_msg));
atm_force_charge(priv->lecd, skb2->truesize); atm_force_charge(priv->lecd, skb2->truesize);
skb_queue_tail(&priv->lecd->sk->sk_receive_queue, skb2); skb_queue_tail(&priv->lecd->sk->sk_receive_queue, skb2);
wake_up(&priv->lecd->sleep); wake_up(priv->lecd->sk->sk_sleep);
} }
if (f != NULL) br_fdb_put_hook(f); if (f != NULL) br_fdb_put_hook(f);
#endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */ #endif /* defined(CONFIG_BRIDGE) || defined(CONFIG_BRIDGE_MODULE) */
...@@ -598,13 +598,13 @@ send_to_lecd(struct lec_priv *priv, atmlec_msg_type type, ...@@ -598,13 +598,13 @@ send_to_lecd(struct lec_priv *priv, atmlec_msg_type type,
atm_force_charge(priv->lecd, skb->truesize); atm_force_charge(priv->lecd, skb->truesize);
skb_queue_tail(&priv->lecd->sk->sk_receive_queue, skb); skb_queue_tail(&priv->lecd->sk->sk_receive_queue, skb);
wake_up(&priv->lecd->sleep); wake_up(priv->lecd->sk->sk_sleep);
if (data != NULL) { if (data != NULL) {
DPRINTK("lec: about to send %d bytes of data\n", data->len); DPRINTK("lec: about to send %d bytes of data\n", data->len);
atm_force_charge(priv->lecd, data->truesize); atm_force_charge(priv->lecd, data->truesize);
skb_queue_tail(&priv->lecd->sk->sk_receive_queue, data); skb_queue_tail(&priv->lecd->sk->sk_receive_queue, data);
wake_up(&priv->lecd->sleep); wake_up(priv->lecd->sk->sk_sleep);
} }
return 0; return 0;
...@@ -686,7 +686,7 @@ lec_push(struct atm_vcc *vcc, struct sk_buff *skb) ...@@ -686,7 +686,7 @@ lec_push(struct atm_vcc *vcc, struct sk_buff *skb)
if (memcmp(skb->data, lec_ctrl_magic, 4) ==0) { /* Control frame, to daemon*/ if (memcmp(skb->data, lec_ctrl_magic, 4) ==0) { /* Control frame, to daemon*/
DPRINTK("%s: To daemon\n",dev->name); DPRINTK("%s: To daemon\n",dev->name);
skb_queue_tail(&vcc->sk->sk_receive_queue, skb); skb_queue_tail(&vcc->sk->sk_receive_queue, skb);
wake_up(&vcc->sleep); wake_up(vcc->sk->sk_sleep);
} else { /* Data frame, queue to protocol handlers */ } else { /* Data frame, queue to protocol handlers */
unsigned char *dst; unsigned char *dst;
......
...@@ -669,7 +669,7 @@ static void mpc_push(struct atm_vcc *vcc, struct sk_buff *skb) ...@@ -669,7 +669,7 @@ static void mpc_push(struct atm_vcc *vcc, struct sk_buff *skb)
dprintk("mpoa: (%s) mpc_push: control packet arrived\n", dev->name); dprintk("mpoa: (%s) mpc_push: control packet arrived\n", dev->name);
/* Pass control packets to daemon */ /* Pass control packets to daemon */
skb_queue_tail(&vcc->sk->sk_receive_queue, skb); skb_queue_tail(&vcc->sk->sk_receive_queue, skb);
wake_up(&vcc->sleep); wake_up(vcc->sk->sk_sleep);
return; return;
} }
...@@ -947,7 +947,7 @@ int msg_to_mpoad(struct k_message *mesg, struct mpoa_client *mpc) ...@@ -947,7 +947,7 @@ int msg_to_mpoad(struct k_message *mesg, struct mpoa_client *mpc)
memcpy(skb->data, mesg, sizeof(struct k_message)); memcpy(skb->data, mesg, sizeof(struct k_message));
atm_force_charge(mpc->mpoad_vcc, skb->truesize); atm_force_charge(mpc->mpoad_vcc, skb->truesize);
skb_queue_tail(&mpc->mpoad_vcc->sk->sk_receive_queue, skb); skb_queue_tail(&mpc->mpoad_vcc->sk->sk_receive_queue, skb);
wake_up(&mpc->mpoad_vcc->sleep); wake_up(mpc->mpoad_vcc->sk->sk_sleep);
return 0; return 0;
} }
...@@ -1226,7 +1226,7 @@ static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry) ...@@ -1226,7 +1226,7 @@ static void purge_egress_shortcut(struct atm_vcc *vcc, eg_cache_entry *entry)
atm_force_charge(vcc, skb->truesize); atm_force_charge(vcc, skb->truesize);
skb_queue_tail(&vcc->sk->sk_receive_queue, skb); skb_queue_tail(&vcc->sk->sk_receive_queue, skb);
wake_up(&vcc->sleep); wake_up(vcc->sk->sk_sleep);
dprintk("mpoa: purge_egress_shortcut: exiting:\n"); dprintk("mpoa: purge_egress_shortcut: exiting:\n");
return; return;
......
...@@ -29,7 +29,7 @@ void atm_push_raw(struct atm_vcc *vcc,struct sk_buff *skb) ...@@ -29,7 +29,7 @@ void atm_push_raw(struct atm_vcc *vcc,struct sk_buff *skb)
{ {
if (skb) { if (skb) {
skb_queue_tail(&vcc->sk->sk_receive_queue, skb); skb_queue_tail(&vcc->sk->sk_receive_queue, skb);
wake_up(&vcc->sleep); wake_up(vcc->sk->sk_sleep);
} }
} }
...@@ -40,7 +40,7 @@ static void atm_pop_raw(struct atm_vcc *vcc,struct sk_buff *skb) ...@@ -40,7 +40,7 @@ static void atm_pop_raw(struct atm_vcc *vcc,struct sk_buff *skb)
skb->truesize); skb->truesize);
atomic_sub(skb->truesize, &vcc->sk->sk_wmem_alloc); atomic_sub(skb->truesize, &vcc->sk->sk_wmem_alloc);
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
wake_up(&vcc->sleep); wake_up(vcc->sk->sk_sleep);
} }
......
...@@ -61,7 +61,7 @@ static void sigd_put_skb(struct sk_buff *skb) ...@@ -61,7 +61,7 @@ static void sigd_put_skb(struct sk_buff *skb)
#endif #endif
atm_force_charge(sigd,skb->truesize); atm_force_charge(sigd,skb->truesize);
skb_queue_tail(&sigd->sk->sk_receive_queue,skb); skb_queue_tail(&sigd->sk->sk_receive_queue,skb);
wake_up(&sigd->sleep); wake_up(sigd->sk->sk_sleep);
} }
...@@ -137,7 +137,7 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb) ...@@ -137,7 +137,7 @@ static int sigd_send(struct atm_vcc *vcc,struct sk_buff *skb)
} }
vcc->sk->sk_ack_backlog++; vcc->sk->sk_ack_backlog++;
skb_queue_tail(&vcc->sk->sk_receive_queue, skb); skb_queue_tail(&vcc->sk->sk_receive_queue, skb);
DPRINTK("waking vcc->sleep 0x%p\n", &vcc->sleep); DPRINTK("waking vcc->sk->sk_sleep 0x%p\n", vcc->sk->sk_sleep);
vcc->sk->sk_state_change(vcc->sk); vcc->sk->sk_state_change(vcc->sk);
as_indicate_complete: as_indicate_complete:
release_sock(vcc->sk); release_sock(vcc->sk);
...@@ -204,7 +204,7 @@ static void purge_vcc(struct atm_vcc *vcc) ...@@ -204,7 +204,7 @@ static void purge_vcc(struct atm_vcc *vcc)
set_bit(ATM_VF_RELEASED,&vcc->flags); set_bit(ATM_VF_RELEASED,&vcc->flags);
vcc->reply = -EUNATCH; vcc->reply = -EUNATCH;
vcc->sk->sk_err = EUNATCH; vcc->sk->sk_err = EUNATCH;
wake_up(&vcc->sleep); wake_up(vcc->sk->sk_sleep);
} }
} }
......
...@@ -56,13 +56,13 @@ static void svc_disconnect(struct atm_vcc *vcc) ...@@ -56,13 +56,13 @@ static void svc_disconnect(struct atm_vcc *vcc)
DPRINTK("svc_disconnect %p\n",vcc); DPRINTK("svc_disconnect %p\n",vcc);
if (test_bit(ATM_VF_REGIS,&vcc->flags)) { if (test_bit(ATM_VF_REGIS,&vcc->flags)) {
prepare_to_wait(&vcc->sleep, &wait, TASK_UNINTERRUPTIBLE); prepare_to_wait(vcc->sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
sigd_enq(vcc,as_close,NULL,NULL,NULL); sigd_enq(vcc,as_close,NULL,NULL,NULL);
while (!test_bit(ATM_VF_RELEASED,&vcc->flags) && sigd) { while (!test_bit(ATM_VF_RELEASED,&vcc->flags) && sigd) {
schedule(); schedule();
prepare_to_wait(&vcc->sleep, &wait, TASK_UNINTERRUPTIBLE); prepare_to_wait(vcc->sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
} }
finish_wait(&vcc->sleep, &wait); finish_wait(vcc->sk->sk_sleep, &wait);
} }
/* beware - socket is still in use by atmsigd until the last /* beware - socket is still in use by atmsigd until the last
as_indicate has been answered */ as_indicate has been answered */
...@@ -138,13 +138,13 @@ static int svc_bind(struct socket *sock,struct sockaddr *sockaddr, ...@@ -138,13 +138,13 @@ static int svc_bind(struct socket *sock,struct sockaddr *sockaddr,
} }
vcc->local = *addr; vcc->local = *addr;
vcc->reply = WAITING; vcc->reply = WAITING;
prepare_to_wait(&vcc->sleep, &wait, TASK_UNINTERRUPTIBLE); prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
sigd_enq(vcc,as_bind,NULL,NULL,&vcc->local); sigd_enq(vcc,as_bind,NULL,NULL,&vcc->local);
while (vcc->reply == WAITING && sigd) { while (vcc->reply == WAITING && sigd) {
schedule(); schedule();
prepare_to_wait(&vcc->sleep, &wait, TASK_UNINTERRUPTIBLE); prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
} }
finish_wait(&vcc->sleep, &wait); finish_wait(sk->sk_sleep, &wait);
clear_bit(ATM_VF_REGIS,&vcc->flags); /* doesn't count */ clear_bit(ATM_VF_REGIS,&vcc->flags); /* doesn't count */
if (!sigd) { if (!sigd) {
error = -EUNATCH; error = -EUNATCH;
...@@ -219,10 +219,10 @@ static int svc_connect(struct socket *sock,struct sockaddr *sockaddr, ...@@ -219,10 +219,10 @@ static int svc_connect(struct socket *sock,struct sockaddr *sockaddr,
} }
vcc->remote = *addr; vcc->remote = *addr;
vcc->reply = WAITING; vcc->reply = WAITING;
prepare_to_wait(&vcc->sleep, &wait, TASK_INTERRUPTIBLE); prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
sigd_enq(vcc,as_connect,NULL,NULL,&vcc->remote); sigd_enq(vcc,as_connect,NULL,NULL,&vcc->remote);
if (flags & O_NONBLOCK) { if (flags & O_NONBLOCK) {
finish_wait(&vcc->sleep, &wait); finish_wait(sk->sk_sleep, &wait);
sock->state = SS_CONNECTING; sock->state = SS_CONNECTING;
error = -EINPROGRESS; error = -EINPROGRESS;
goto out; goto out;
...@@ -231,7 +231,7 @@ static int svc_connect(struct socket *sock,struct sockaddr *sockaddr, ...@@ -231,7 +231,7 @@ static int svc_connect(struct socket *sock,struct sockaddr *sockaddr,
while (vcc->reply == WAITING && sigd) { while (vcc->reply == WAITING && sigd) {
schedule(); schedule();
if (!signal_pending(current)) { if (!signal_pending(current)) {
prepare_to_wait(&vcc->sleep, &wait, TASK_INTERRUPTIBLE); prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
continue; continue;
} }
DPRINTK("*ABORT*\n"); DPRINTK("*ABORT*\n");
...@@ -249,13 +249,13 @@ static int svc_connect(struct socket *sock,struct sockaddr *sockaddr, ...@@ -249,13 +249,13 @@ static int svc_connect(struct socket *sock,struct sockaddr *sockaddr,
*/ */
sigd_enq(vcc,as_close,NULL,NULL,NULL); sigd_enq(vcc,as_close,NULL,NULL,NULL);
while (vcc->reply == WAITING && sigd) { while (vcc->reply == WAITING && sigd) {
prepare_to_wait(&vcc->sleep, &wait, TASK_INTERRUPTIBLE); prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
schedule(); schedule();
} }
if (!vcc->reply) if (!vcc->reply)
while (!test_bit(ATM_VF_RELEASED,&vcc->flags) while (!test_bit(ATM_VF_RELEASED,&vcc->flags)
&& sigd) { && sigd) {
prepare_to_wait(&vcc->sleep, &wait, TASK_INTERRUPTIBLE); prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
schedule(); schedule();
} }
clear_bit(ATM_VF_REGIS,&vcc->flags); clear_bit(ATM_VF_REGIS,&vcc->flags);
...@@ -265,7 +265,7 @@ static int svc_connect(struct socket *sock,struct sockaddr *sockaddr, ...@@ -265,7 +265,7 @@ static int svc_connect(struct socket *sock,struct sockaddr *sockaddr,
error = -EINTR; error = -EINTR;
break; break;
} }
finish_wait(&vcc->sleep, &wait); finish_wait(sk->sk_sleep, &wait);
if (error) if (error)
goto out; goto out;
if (!sigd) { if (!sigd) {
...@@ -312,13 +312,13 @@ static int svc_listen(struct socket *sock,int backlog) ...@@ -312,13 +312,13 @@ static int svc_listen(struct socket *sock,int backlog)
goto out; goto out;
} }
vcc->reply = WAITING; vcc->reply = WAITING;
prepare_to_wait(&vcc->sleep, &wait, TASK_UNINTERRUPTIBLE); prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
sigd_enq(vcc,as_listen,NULL,NULL,&vcc->local); sigd_enq(vcc,as_listen,NULL,NULL,&vcc->local);
while (vcc->reply == WAITING && sigd) { while (vcc->reply == WAITING && sigd) {
schedule(); schedule();
prepare_to_wait(&vcc->sleep, &wait, TASK_UNINTERRUPTIBLE); prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
} }
finish_wait(&vcc->sleep, &wait); finish_wait(sk->sk_sleep, &wait);
if (!sigd) { if (!sigd) {
error = -EUNATCH; error = -EUNATCH;
goto out; goto out;
...@@ -354,7 +354,7 @@ static int svc_accept(struct socket *sock,struct socket *newsock,int flags) ...@@ -354,7 +354,7 @@ static int svc_accept(struct socket *sock,struct socket *newsock,int flags)
while (1) { while (1) {
DEFINE_WAIT(wait); DEFINE_WAIT(wait);
prepare_to_wait(&old_vcc->sleep, &wait, TASK_INTERRUPTIBLE); prepare_to_wait(old_vcc->sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
while (!(skb = skb_dequeue(&old_vcc->sk->sk_receive_queue)) && while (!(skb = skb_dequeue(&old_vcc->sk->sk_receive_queue)) &&
sigd) { sigd) {
if (test_bit(ATM_VF_RELEASED,&old_vcc->flags)) break; if (test_bit(ATM_VF_RELEASED,&old_vcc->flags)) break;
...@@ -373,9 +373,9 @@ static int svc_accept(struct socket *sock,struct socket *newsock,int flags) ...@@ -373,9 +373,9 @@ static int svc_accept(struct socket *sock,struct socket *newsock,int flags)
error = -ERESTARTSYS; error = -ERESTARTSYS;
break; break;
} }
prepare_to_wait(&old_vcc->sleep, &wait, TASK_INTERRUPTIBLE); prepare_to_wait(old_vcc->sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
} }
finish_wait(&old_vcc->sleep, &wait); finish_wait(old_vcc->sk->sk_sleep, &wait);
if (error) if (error)
goto out; goto out;
if (!skb) { if (!skb) {
...@@ -400,15 +400,15 @@ static int svc_accept(struct socket *sock,struct socket *newsock,int flags) ...@@ -400,15 +400,15 @@ static int svc_accept(struct socket *sock,struct socket *newsock,int flags)
} }
/* wait should be short, so we ignore the non-blocking flag */ /* wait should be short, so we ignore the non-blocking flag */
new_vcc->reply = WAITING; new_vcc->reply = WAITING;
prepare_to_wait(&new_vcc->sleep, &wait, TASK_UNINTERRUPTIBLE); prepare_to_wait(new_vcc->sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
sigd_enq(new_vcc,as_accept,old_vcc,NULL,NULL); sigd_enq(new_vcc,as_accept,old_vcc,NULL,NULL);
while (new_vcc->reply == WAITING && sigd) { while (new_vcc->reply == WAITING && sigd) {
release_sock(sk); release_sock(sk);
schedule(); schedule();
lock_sock(sk); lock_sock(sk);
prepare_to_wait(&new_vcc->sleep, &wait, TASK_UNINTERRUPTIBLE); prepare_to_wait(new_vcc->sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
} }
finish_wait(&new_vcc->sleep, &wait); finish_wait(new_vcc->sk->sk_sleep, &wait);
if (!sigd) { if (!sigd) {
error = -EUNATCH; error = -EUNATCH;
goto out; goto out;
...@@ -444,14 +444,14 @@ int svc_change_qos(struct atm_vcc *vcc,struct atm_qos *qos) ...@@ -444,14 +444,14 @@ int svc_change_qos(struct atm_vcc *vcc,struct atm_qos *qos)
DEFINE_WAIT(wait); DEFINE_WAIT(wait);
vcc->reply = WAITING; vcc->reply = WAITING;
prepare_to_wait(&vcc->sleep, &wait, TASK_UNINTERRUPTIBLE); prepare_to_wait(vcc->sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
sigd_enq2(vcc,as_modify,NULL,NULL,&vcc->local,qos,0); sigd_enq2(vcc,as_modify,NULL,NULL,&vcc->local,qos,0);
while (vcc->reply == WAITING && !test_bit(ATM_VF_RELEASED,&vcc->flags) while (vcc->reply == WAITING && !test_bit(ATM_VF_RELEASED,&vcc->flags)
&& sigd) { && sigd) {
schedule(); schedule();
prepare_to_wait(&vcc->sleep, &wait, TASK_UNINTERRUPTIBLE); prepare_to_wait(vcc->sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
} }
finish_wait(&vcc->sleep, &wait); finish_wait(vcc->sk->sk_sleep, &wait);
if (!sigd) return -EUNATCH; if (!sigd) return -EUNATCH;
return vcc->reply; return vcc->reply;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment