diff options
author | Jason Gunthorpe | 2018-11-25 20:51:14 +0200 |
---|---|---|
committer | Jason Gunthorpe | 2018-11-26 16:48:07 -0700 |
commit | 7106a9769715bb4c0448927a29aa3b505855871c (patch) | |
tree | 48bfaac92a7adfedbf50c224bf054f519008c3b4 /include/rdma | |
parent | 8313c10fa8be032fccc1e757bccc21207f533127 (diff) |
RDMA/uverbs: Make write() handlers return 0 on success
Currently they return the command length, while all other handlers return
0. This makes the write path closer to the write_ex and ioctl path.
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_ioctl.h | 6 | ||||
-rw-r--r-- | include/rdma/uverbs_std_types.h | 12 |
2 files changed, 8 insertions, 10 deletions
diff --git a/include/rdma/uverbs_ioctl.h b/include/rdma/uverbs_ioctl.h index f744691cd9ae..2a59d6ad9f62 100644 --- a/include/rdma/uverbs_ioctl.h +++ b/include/rdma/uverbs_ioctl.h @@ -368,9 +368,9 @@ struct uapi_definition { union { bool (*func_is_supported)(struct ib_device *device); - ssize_t (*func_write)(struct uverbs_attr_bundle *attrs, - const char __user *buf, int in_len, - int out_len); + int (*func_write)(struct uverbs_attr_bundle *attrs, + const char __user *buf, int in_len, + int out_len); int (*func_write_ex)(struct uverbs_attr_bundle *attrs, struct ib_udata *ucore, struct ib_udata *uhw); diff --git a/include/rdma/uverbs_std_types.h b/include/rdma/uverbs_std_types.h index a6358c36bba0..df878ce02c94 100644 --- a/include/rdma/uverbs_std_types.h +++ b/include/rdma/uverbs_std_types.h @@ -72,11 +72,10 @@ static inline void *_uobj_get_obj_read(struct ib_uobject *uobj) _uobj_check_id(_id), UVERBS_LOOKUP_WRITE) int __uobj_perform_destroy(const struct uverbs_api_object *obj, u32 id, - const struct uverbs_attr_bundle *attrs, - int success_res); -#define uobj_perform_destroy(_type, _id, _attrs, _success_res) \ + const struct uverbs_attr_bundle *attrs); +#define uobj_perform_destroy(_type, _id, _attrs) \ __uobj_perform_destroy(uobj_get_type(_attrs, _type), \ - _uobj_check_id(_id), _attrs, _success_res) + _uobj_check_id(_id), _attrs) struct ib_uobject *__uobj_get_destroy(const struct uverbs_api_object *obj, u32 id, @@ -104,14 +103,13 @@ static inline void uobj_put_write(struct ib_uobject *uobj) rdma_lookup_put_uobject(uobj, UVERBS_LOOKUP_WRITE); } -static inline int __must_check uobj_alloc_commit(struct ib_uobject *uobj, - int success_res) +static inline int __must_check uobj_alloc_commit(struct ib_uobject *uobj) { int ret = rdma_alloc_commit_uobject(uobj); if (ret) return ret; - return success_res; + return 0; } static inline void uobj_alloc_abort(struct ib_uobject *uobj) |