Commit 3208896d authored by Trond Myklebust's avatar Trond Myklebust

RPC,NFS: remove instances of tests for waitqueue_active(). Those can be racy.

RPC: remove unnecessary support for sk->sk_sleep on those sockets that are
  owned by the RPC client.
parent bbc8ea9e
...@@ -100,7 +100,6 @@ nfs_unlock_request(struct nfs_page *req) ...@@ -100,7 +100,6 @@ nfs_unlock_request(struct nfs_page *req)
smp_mb__before_clear_bit(); smp_mb__before_clear_bit();
clear_bit(PG_BUSY, &req->wb_flags); clear_bit(PG_BUSY, &req->wb_flags);
smp_mb__after_clear_bit(); smp_mb__after_clear_bit();
if (waitqueue_active(&req->wb_wait))
wake_up_all(&req->wb_wait); wake_up_all(&req->wb_wait);
nfs_release_request(req); nfs_release_request(req);
} }
......
...@@ -255,12 +255,10 @@ rpc_make_runnable(struct rpc_task *task) ...@@ -255,12 +255,10 @@ rpc_make_runnable(struct rpc_task *task)
return; return;
} }
rpc_clear_sleeping(task); rpc_clear_sleeping(task);
if (waitqueue_active(&rpciod_idle))
wake_up(&rpciod_idle); wake_up(&rpciod_idle);
} }
} else { } else {
rpc_clear_sleeping(task); rpc_clear_sleeping(task);
if (waitqueue_active(&task->tk_wait))
wake_up(&task->tk_wait); wake_up(&task->tk_wait);
} }
} }
...@@ -287,7 +285,6 @@ void rpciod_wake_up(void) ...@@ -287,7 +285,6 @@ void rpciod_wake_up(void)
{ {
if(rpciod_pid==0) if(rpciod_pid==0)
printk(KERN_ERR "rpciod: wot no daemon?\n"); printk(KERN_ERR "rpciod: wot no daemon?\n");
if (waitqueue_active(&rpciod_idle))
wake_up(&rpciod_idle); wake_up(&rpciod_idle);
} }
......
...@@ -782,8 +782,6 @@ udp_data_ready(struct sock *sk, int len) ...@@ -782,8 +782,6 @@ udp_data_ready(struct sock *sk, int len)
dropit: dropit:
skb_free_datagram(sk, skb); skb_free_datagram(sk, skb);
out: out:
if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
wake_up_interruptible(sk->sk_sleep);
read_unlock(&sk->sk_callback_lock); read_unlock(&sk->sk_callback_lock);
} }
...@@ -1043,8 +1041,6 @@ tcp_state_change(struct sock *sk) ...@@ -1043,8 +1041,6 @@ tcp_state_change(struct sock *sk)
break; break;
} }
out: out:
if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
wake_up_interruptible_all(sk->sk_sleep);
read_unlock(&sk->sk_callback_lock); read_unlock(&sk->sk_callback_lock);
} }
...@@ -1084,8 +1080,6 @@ xprt_write_space(struct sock *sk) ...@@ -1084,8 +1080,6 @@ xprt_write_space(struct sock *sk)
if (xprt->snd_task && xprt->snd_task->tk_rpcwait == &xprt->pending) if (xprt->snd_task && xprt->snd_task->tk_rpcwait == &xprt->pending)
rpc_wake_up_task(xprt->snd_task); rpc_wake_up_task(xprt->snd_task);
spin_unlock_bh(&xprt->sock_lock); spin_unlock_bh(&xprt->sock_lock);
if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
wake_up_interruptible(sk->sk_sleep);
out: out:
read_unlock(&sk->sk_callback_lock); read_unlock(&sk->sk_callback_lock);
} }
...@@ -1626,7 +1620,6 @@ xprt_shutdown(struct rpc_xprt *xprt) ...@@ -1626,7 +1620,6 @@ xprt_shutdown(struct rpc_xprt *xprt)
rpc_wake_up(&xprt->resend); rpc_wake_up(&xprt->resend);
rpc_wake_up(&xprt->pending); rpc_wake_up(&xprt->pending);
rpc_wake_up(&xprt->backlog); rpc_wake_up(&xprt->backlog);
if (waitqueue_active(&xprt->cong_wait))
wake_up(&xprt->cong_wait); wake_up(&xprt->cong_wait);
del_timer_sync(&xprt->timer); del_timer_sync(&xprt->timer);
} }
...@@ -1637,7 +1630,6 @@ xprt_shutdown(struct rpc_xprt *xprt) ...@@ -1637,7 +1630,6 @@ xprt_shutdown(struct rpc_xprt *xprt)
int int
xprt_clear_backlog(struct rpc_xprt *xprt) { xprt_clear_backlog(struct rpc_xprt *xprt) {
rpc_wake_up_next(&xprt->backlog); rpc_wake_up_next(&xprt->backlog);
if (waitqueue_active(&xprt->cong_wait))
wake_up(&xprt->cong_wait); wake_up(&xprt->cong_wait);
return 1; return 1;
} }
......
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