|
|
@@ -701,30 +701,30 @@ void rxrpc_destroy_all_calls(struct rxrpc_net *rxnet)
|
|
|
|
|
|
_enter("");
|
|
|
|
|
|
- if (list_empty(&rxnet->calls))
|
|
|
- return;
|
|
|
+ if (!list_empty(&rxnet->calls)) {
|
|
|
+ write_lock(&rxnet->call_lock);
|
|
|
|
|
|
- write_lock(&rxnet->call_lock);
|
|
|
+ while (!list_empty(&rxnet->calls)) {
|
|
|
+ call = list_entry(rxnet->calls.next,
|
|
|
+ struct rxrpc_call, link);
|
|
|
+ _debug("Zapping call %p", call);
|
|
|
|
|
|
- while (!list_empty(&rxnet->calls)) {
|
|
|
- call = list_entry(rxnet->calls.next, struct rxrpc_call, link);
|
|
|
- _debug("Zapping call %p", call);
|
|
|
+ rxrpc_see_call(call);
|
|
|
+ list_del_init(&call->link);
|
|
|
|
|
|
- rxrpc_see_call(call);
|
|
|
- list_del_init(&call->link);
|
|
|
+ pr_err("Call %p still in use (%d,%s,%lx,%lx)!\n",
|
|
|
+ call, atomic_read(&call->usage),
|
|
|
+ rxrpc_call_states[call->state],
|
|
|
+ call->flags, call->events);
|
|
|
|
|
|
- pr_err("Call %p still in use (%d,%s,%lx,%lx)!\n",
|
|
|
- call, atomic_read(&call->usage),
|
|
|
- rxrpc_call_states[call->state],
|
|
|
- call->flags, call->events);
|
|
|
+ write_unlock(&rxnet->call_lock);
|
|
|
+ cond_resched();
|
|
|
+ write_lock(&rxnet->call_lock);
|
|
|
+ }
|
|
|
|
|
|
write_unlock(&rxnet->call_lock);
|
|
|
- cond_resched();
|
|
|
- write_lock(&rxnet->call_lock);
|
|
|
}
|
|
|
|
|
|
- write_unlock(&rxnet->call_lock);
|
|
|
-
|
|
|
atomic_dec(&rxnet->nr_calls);
|
|
|
wait_var_event(&rxnet->nr_calls, !atomic_read(&rxnet->nr_calls));
|
|
|
}
|