patch-2.2.14 linux/net/sunrpc/svcsock.c
Next file: linux/net/sunrpc/xprt.c
Previous file: linux/net/sunrpc/svc.c
Back to the patch index
Back to the overall index
- Lines: 60
- Date:
Tue Jan 4 10:12:27 2000
- Orig file:
v2.2.13/linux/net/sunrpc/svcsock.c
- Orig date:
Tue Jan 4 11:10:43 2000
diff -u --recursive --new-file v2.2.13/linux/net/sunrpc/svcsock.c linux/net/sunrpc/svcsock.c
@@ -124,7 +124,7 @@
"svc_sock_enqueue: server %p, rq_sock=%p!\n",
rqstp, rqstp->rq_sock);
rqstp->rq_sock = svsk;
- svsk->sk_inuse++;
+ atomic_inc(&svsk->sk_inuse);
wake_up(&rqstp->rq_wait);
} else {
dprintk("svc: socket %p put into queue\n", svsk->sk_sk);
@@ -148,7 +148,7 @@
if (svsk) {
dprintk("svc: socket %p dequeued, inuse=%d\n",
- svsk->sk_sk, svsk->sk_inuse);
+ svsk->sk_sk, atomic_read(&svsk->sk_inuse));
svsk->sk_qued = 0;
}
@@ -206,7 +206,7 @@
return;
svc_release_skb(rqstp);
rqstp->rq_sock = NULL;
- if (!--(svsk->sk_inuse) && svsk->sk_dead) {
+ if (atomic_dec_and_test(&svsk->sk_inuse) && svsk->sk_dead) {
dprintk("svc: releasing dead socket\n");
sock_release(svsk->sk_sock);
kfree(svsk);
@@ -766,7 +766,7 @@
start_bh_atomic();
if ((svsk = svc_sock_dequeue(serv)) != NULL) {
rqstp->rq_sock = svsk;
- svsk->sk_inuse++;
+ atomic_inc(&svsk->sk_inuse);
} else {
/* No data pending. Go to sleep */
svc_serv_enqueue(serv, rqstp);
@@ -793,7 +793,7 @@
end_bh_atomic();
dprintk("svc: server %p, socket %p, inuse=%d\n",
- rqstp, svsk, svsk->sk_inuse);
+ rqstp, svsk, atomic_read(&svsk->sk_inuse));
len = svsk->sk_recvfrom(rqstp);
dprintk("svc: got len=%d\n", len);
@@ -988,11 +988,12 @@
rpc_remove_list(&serv->sv_sockets, svsk);
svsk->sk_dead = 1;
- if (!svsk->sk_inuse) {
+ if (!atomic_read(&svsk->sk_inuse)) {
sock_release(svsk->sk_sock);
kfree(svsk);
} else {
- printk(KERN_NOTICE "svc: server socket destroy delayed\n");
+ printk(KERN_NOTICE "svc: server socket destroy delayed (sk_inuse: %d)\n",
+ atomic_read(&svsk->sk_inuse));
/* svsk->sk_server = NULL; */
}
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)