OSDN Git Service

IB/uverbs: Do not pass struct ib_device to the ioctl methods
authorJason Gunthorpe <jgg@mellanox.com>
Thu, 26 Jul 2018 03:40:18 +0000 (21:40 -0600)
committerJason Gunthorpe <jgg@mellanox.com>
Wed, 1 Aug 2018 20:55:48 +0000 (14:55 -0600)
commite83f0ecdc40f2c3d63ff0e7f17462a29d12684a2
tree3d8df27cf0e51e1353f49582cde9235c29603856
parentbbd51e881ff05aa6dccda025e335438f3b3a1dba
IB/uverbs: Do not pass struct ib_device to the ioctl methods

This does the same as the patch before, except for ioctl. The rules are
the same, but for the ioctl methods the core code handles setting up the
uobject.

- Retrieve the ib_dev from the uobject->context->device. This is
  safe under ioctl as the core has already done rdma_alloc_begin_uobject
  and so CREATE calls are entirely protected by the rwsem.
- Retrieve the ib_dev from uobject->object
- Call ib_uverbs_get_ucontext()

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/core/uverbs_ioctl.c
drivers/infiniband/core/uverbs_std_types.c
drivers/infiniband/core/uverbs_std_types_counters.c
drivers/infiniband/core/uverbs_std_types_cq.c
drivers/infiniband/core/uverbs_std_types_dm.c
drivers/infiniband/core/uverbs_std_types_flow_action.c
drivers/infiniband/core/uverbs_std_types_mr.c
drivers/infiniband/hw/mlx5/devx.c
drivers/infiniband/hw/mlx5/flow.c
include/rdma/ib_verbs.h
include/rdma/uverbs_ioctl.h