diff options
| author | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-04 04:32:06 -0400 |
|---|---|---|
| committer | Jason Gunthorpe <jgg@mellanox.com> | 2018-07-09 13:26:17 -0400 |
| commit | c33e73af2183fb9fcd993e37abcdecc058b22d91 (patch) | |
| tree | f85591d06f6362c845a38f8473be7916ee238822 /include/rdma | |
| parent | 422e3d37ed7ea8b421208a44913c420055334976 (diff) | |
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, | |||
| 71 | #define uobj_get_write(_type, _id, _ucontext) \ | 71 | #define uobj_get_write(_type, _id, _ucontext) \ |
| 72 | __uobj_get(uobj_get_type(_type), true, _ucontext, _id) | 72 | __uobj_get(uobj_get_type(_type), true, _ucontext, _id) |
| 73 | 73 | ||
| 74 | int __uobj_perform_destroy(const struct uverbs_obj_type *type, int id, | ||
| 75 | struct ib_uverbs_file *ufile, int success_res); | ||
| 76 | #define uobj_perform_destroy(_type, _id, _ufile, _success_res) \ | ||
| 77 | __uobj_perform_destroy(uobj_get_type(_type), _id, _ufile, _success_res) | ||
| 78 | |||
| 74 | static inline void uobj_put_read(struct ib_uobject *uobj) | 79 | static inline void uobj_put_read(struct ib_uobject *uobj) |
| 75 | { | 80 | { |
| 76 | rdma_lookup_put_uobject(uobj, false); | 81 | rdma_lookup_put_uobject(uobj, false); |
