summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/rxrpc/conn_client.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/net/rxrpc/conn_client.c b/net/rxrpc/conn_client.c
index f5ee8bf..60ef960 100644
--- a/net/rxrpc/conn_client.c
+++ b/net/rxrpc/conn_client.c
@@ -576,28 +576,42 @@ static void rxrpc_activate_one_channel(struct rxrpc_connection *conn,
}
/*
+ * Assign channels and callNumbers to waiting calls with channel_lock
+ * held by caller.
+ */
+static void rxrpc_activate_channels_locked(struct rxrpc_connection *conn)
+{
+ u8 avail, mask;
+
+ switch (conn->cache_state) {
+ case RXRPC_CONN_CLIENT_ACTIVE:
+ mask = RXRPC_ACTIVE_CHANS_MASK;
+ break;
+ default:
+ return;
+ }
+
+ while (!list_empty(&conn->waiting_calls) &&
+ (avail = ~conn->active_chans,
+ avail &= mask,
+ avail != 0))
+ rxrpc_activate_one_channel(conn, __ffs(avail));
+}
+
+/*
* Assign channels and callNumbers to waiting calls.
*/
static void rxrpc_activate_channels(struct rxrpc_connection *conn)
{
- unsigned char mask;
-
_enter("%d", conn->debug_id);
trace_rxrpc_client(conn, -1, rxrpc_client_activate_chans);
- if (conn->cache_state != RXRPC_CONN_CLIENT_ACTIVE ||
- conn->active_chans == RXRPC_ACTIVE_CHANS_MASK)
+ if (conn->active_chans == RXRPC_ACTIVE_CHANS_MASK)
return;
spin_lock(&conn->channel_lock);
-
- while (!list_empty(&conn->waiting_calls) &&
- (mask = ~conn->active_chans,
- mask &= RXRPC_ACTIVE_CHANS_MASK,
- mask != 0))
- rxrpc_activate_one_channel(conn, __ffs(mask));
-
+ rxrpc_activate_channels_locked(conn);
spin_unlock(&conn->channel_lock);
_leave("");
}
OpenPOWER on IntegriCloud