RDMA/cma: Split apart the multiple uses of the same list heads
authorJason Gunthorpe <jgg@nvidia.com>
Wed, 15 Sep 2021 16:25:19 +0000 (13:25 -0300)
committerJason Gunthorpe <jgg@nvidia.com>
Mon, 4 Oct 2021 19:07:39 +0000 (16:07 -0300)
commit99cfddb8a8bd57122effa808653dec83408705a6
treefe7add88e7134dac19600ecd201b9f8ebc3435b0
parentc78d218fc5a9995d6b50aa38814bef4fbc88a77d
RDMA/cma: Split apart the multiple uses of the same list heads

Two list heads in the rdma_id_private are being used for multiple
purposes, to save a few bytes of memory. Give the different purposes
different names and union the memory that is clearly exclusive.

list splits into device_item and listen_any_item. device_item is threaded
onto the cma_device's list and listen_any goes onto the
listen_any_list. IDs doing any listen cannot have devices.

listen_list splits into listen_item and listen_list. listen_list is on the
parent listen any rdma_id_private and listen_item is on child listen that
is bound to a specific cma_dev.

Which name should be used in which case depends on the state and other
factors of the rdma_id_private. Remap all the confusing references to make
sense with the new names, so at least there is some hope of matching the
necessary preconditions with each access.

Link: https://lore.kernel.org/r/0-v1-a5ead4a0c19d+c3a-cma_list_head_jgg@nvidia.com
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/core/cma.c
drivers/infiniband/core/cma_priv.h