aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma/uverbs_types.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/rdma/uverbs_types.h')
-rw-r--r--include/rdma/uverbs_types.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/rdma/uverbs_types.h b/include/rdma/uverbs_types.h
index 58674290fab0..a37692167a45 100644
--- a/include/rdma/uverbs_types.h
+++ b/include/rdma/uverbs_types.h
@@ -146,9 +146,18 @@ struct uverbs_obj_fd_type {
};
extern const struct uverbs_obj_type_class uverbs_idr_class;
+extern const struct uverbs_obj_type_class uverbs_fd_class;
#define UVERBS_BUILD_BUG_ON(cond) (sizeof(char[1 - 2 * !!(cond)]) - \
sizeof(char))
+#define UVERBS_TYPE_ALLOC_FD(_size, _order) \
+ { \
+ .destroy_order = _order, \
+ .type_class = &uverbs_fd_class, \
+ .obj_size = (_size) + \
+ UVERBS_BUILD_BUG_ON((_size) < \
+ sizeof(struct ib_uobject_file)),\
+ }
#define UVERBS_TYPE_ALLOC_IDR_SZ(_size, _order) \
{ \
.destroy_order = _order, \