diff options
author | Leon Romanovsky <leonro@mellanox.com> | 2020-09-22 12:11:06 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2020-09-22 19:47:35 -0300 |
commit | b09c4d70122091c1865cb63a9c4dad1a94a8e339 (patch) | |
tree | 7ae2c6e859910c68eab58468888a118e705d9068 /drivers/infiniband/core/core_priv.h | |
parent | c34a23c28c6b0045b1f21649de30f68da72547af (diff) |
RDMA/restrack: Improve readability in task name management
Use rdma_restrack_set_name() and rdma_restrack_parent_name() instead of
tricky uses of rdma_restrack_attach_task()/rdma_restrack_uadd().
This uniformly makes all restracks add'd using rdma_restrack_add().
Link: https://lore.kernel.org/r/20200922091106.2152715-6-leon@kernel.org
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband/core/core_priv.h')
-rw-r--r-- | drivers/infiniband/core/core_priv.h | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/infiniband/core/core_priv.h b/drivers/infiniband/core/core_priv.h index cf5a50cefa39..e84b0fedaacb 100644 --- a/drivers/infiniband/core/core_priv.h +++ b/drivers/infiniband/core/core_priv.h @@ -361,15 +361,9 @@ static inline struct ib_qp *_ib_create_qp(struct ib_device *dev, */ is_xrc = qp_type == IB_QPT_XRC_INI || qp_type == IB_QPT_XRC_TGT; if ((qp_type < IB_QPT_MAX && !is_xrc) || qp_type == IB_QPT_DRIVER) { - if (uobj) - rdma_restrack_uadd(&qp->res); - else { - rdma_restrack_set_task(&qp->res, pd->res.kern_name); - rdma_restrack_add(&qp->res); - } - } else - qp->res.valid = false; - + rdma_restrack_parent_name(&qp->res, &pd->res); + rdma_restrack_add(&qp->res); + } return qp; } |