diff options
author | Matan Barak <matanb@mellanox.com> | 2017-04-04 13:31:46 +0300 |
---|---|---|
committer | Doug Ledford <dledford@redhat.com> | 2017-04-05 13:28:04 -0400 |
commit | cf8966b3477d5e6545393bb4499f2051ea554c62 (patch) | |
tree | 35603e0915ee4d20c591b4bdcbf7e6afc81f7834 /drivers/infiniband/core/rdma_core.h | |
parent | f48b726920d96dcd1860df06143bdea7d6d7dcc3 (diff) | |
download | linux-stable-cf8966b3477d5e6545393bb4499f2051ea554c62.tar.gz linux-stable-cf8966b3477d5e6545393bb4499f2051ea554c62.tar.bz2 linux-stable-cf8966b3477d5e6545393bb4499f2051ea554c62.zip |
IB/core: Add support for fd objects
The completion channel we use in verbs infrastructure is FD based.
Previously, we had a separate way to manage this object. Since we
strive for a single way to manage any kind of object in this
infrastructure, we conceptually treat all objects as subclasses
of ib_uobject.
This commit adds the necessary mechanism to support FD based objects
like their IDR counterparts. FD objects release need to be synchronized
with context release. We use the cleanup_mutex on the uverbs_file for
that.
Signed-off-by: Matan Barak <matanb@mellanox.com>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/core/rdma_core.h')
-rw-r--r-- | drivers/infiniband/core/rdma_core.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/infiniband/core/rdma_core.h b/drivers/infiniband/core/rdma_core.h index 0247bb5e3dd3..1b82e7ff7fe8 100644 --- a/drivers/infiniband/core/rdma_core.h +++ b/drivers/infiniband/core/rdma_core.h @@ -67,4 +67,12 @@ void uverbs_uobject_get(struct ib_uobject *uobject); */ void uverbs_uobject_put(struct ib_uobject *uobject); +/* Indicate this fd is no longer used by this consumer, but its memory isn't + * necessarily released yet. When the last reference is put, we release the + * memory. After this call is executed, calling uverbs_uobject_get isn't + * allowed. + * This must be called from the release file_operations of the file! + */ +void uverbs_close_fd(struct file *f); + #endif /* RDMA_CORE_H */ |