]> git.baikalelectronics.ru Git - kernel.git/commit
RDMA/device: Expose ib_device_try_get(()
authorJason Gunthorpe <jgg@mellanox.com>
Thu, 10 Jan 2019 21:02:24 +0000 (14:02 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Mon, 21 Jan 2019 21:33:08 +0000 (14:33 -0700)
commite642ed4a3cc2a9797c7486874dfff290196fedb7
tree7f85b5b6562306c00edf2b86981066779c02862b
parentf6d958da87d94911f3a5fedcf473ddc9e4ee4869
RDMA/device: Expose ib_device_try_get(()

It turns out future patches need this capability quite widely now, not
just for netlink, so provide two global functions to manage the
registration lock refcount.

This also moves the point the lock becomes 1 to within
ib_register_device() so that the semantics of the public API are very sane
and clear. Calling ib_device_try_get() will fail on devices that are only
allocated but not yet registered.

Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Reviewed-by: Parav Pandit <parav@mellanox.com>
drivers/infiniband/core/core_priv.h
drivers/infiniband/core/device.c
include/rdma/ib_verbs.h