diff options
author | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-04 11:32:06 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-09 11:26:17 -0600 |
commit | c33e73af2183fb9fcd993e37abcdecc058b22d91 (patch) | |
tree | f85591d06f6362c845a38f8473be7916ee238822 /include/rdma | |
parent | 422e3d37ed7ea8b421208a44913c420055334976 (diff) | |
download | linux-c33e73af2183fb9fcd993e37abcdecc058b22d91.tar.bz2 |
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')
-rw-r--r-- | include/rdma/uverbs_std_types.h | 5 |
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); |