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>
This commit is contained in:
Matan Barak
2017-04-04 13:31:46 +03:00
committed by Doug Ledford
parent f48b726920
commit cf8966b347
6 changed files with 210 additions and 2 deletions

View File

@@ -1421,6 +1421,12 @@ struct ib_uobject {
const struct uverbs_obj_type *type;
};
struct ib_uobject_file {
struct ib_uobject uobj;
/* ufile contains the lock between context release and file close */
struct ib_uverbs_file *ufile;
};
struct ib_udata {
const void __user *inbuf;
void __user *outbuf;