aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma/uverbs_std_types.h
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2018-07-04 11:32:06 +0300
committerJason Gunthorpe <jgg@mellanox.com>2018-07-09 11:26:17 -0600
commitc33e73af2183fb9fcd993e37abcdecc058b22d91 (patch)
treef85591d06f6362c845a38f8473be7916ee238822 /include/rdma/uverbs_std_types.h
parentRDMA/uverbs: Combine MIN_SZ_OR_ZERO with UVERBS_ATTR_STRUCT (diff)
downloadlinux-dev-c33e73af2183fb9fcd993e37abcdecc058b22d91.tar.xz
linux-dev-c33e73af2183fb9fcd993e37abcdecc058b22d91.zip
IB/uverbs: Add a uobj_perform_destroy helper
This consolidates a bunch of repeated code patterns into a helper. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com> Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'include/rdma/uverbs_std_types.h')
-rw-r--r--include/rdma/uverbs_std_types.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/rdma/uverbs_std_types.h b/include/rdma/uverbs_std_types.h
index 4c151b67fb6d..27c24453fc12 100644
--- a/include/rdma/uverbs_std_types.h
+++ b/include/rdma/uverbs_std_types.h
@@ -71,6 +71,11 @@ static inline struct ib_uobject *__uobj_get(const struct uverbs_obj_type *type,
#define uobj_get_write(_type, _id, _ucontext) \
__uobj_get(uobj_get_type(_type), true, _ucontext, _id)
+int __uobj_perform_destroy(const struct uverbs_obj_type *type, int id,
+ struct ib_uverbs_file *ufile, int success_res);
+#define uobj_perform_destroy(_type, _id, _ufile, _success_res) \
+ __uobj_perform_destroy(uobj_get_type(_type), _id, _ufile, _success_res)
+
static inline void uobj_put_read(struct ib_uobject *uobj)
{
rdma_lookup_put_uobject(uobj, false);