]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/rxrpc/conn_client.c
Merge branch 'misc' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild
[linux.git] / net / rxrpc / conn_client.c
index 60ef9605167ef8b79dd850e2cc5932dfc3ed3e3c..6cbcdcc298534a4704f6383c3486ce6b82f432c9 100644 (file)
@@ -263,12 +263,12 @@ static bool rxrpc_may_reuse_conn(struct rxrpc_connection *conn)
         * times the maximum number of client conns away from the current
         * allocation point to try and keep the IDs concentrated.
         */
-       id_cursor = READ_ONCE(rxrpc_client_conn_ids.cur);
+       id_cursor = idr_get_cursor(&rxrpc_client_conn_ids);
        id = conn->proto.cid >> RXRPC_CIDSHIFT;
        distance = id - id_cursor;
        if (distance < 0)
                distance = -distance;
-       limit = round_up(rxrpc_max_client_connections, IDR_SIZE) * 4;
+       limit = max(rxrpc_max_client_connections * 4, 1024U);
        if (distance > limit)
                goto mark_dont_reuse;