IB/core: Declare an object instead of declaring only type attributes

Switch all uverbs_type_attrs_xxxx with DECLARE_UVERBS_OBJECT
macros. This will be later used in order to embed the object
specific methods in the objects as well.

Signed-off-by: Matan Barak <matanb@mellanox.com>
Reviewed-by: Yishai Hadas <yishaih@mellanox.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
Matan Barak
2017-08-03 16:06:58 +03:00
committed by Doug Ledford
parent fac9658cab
commit 5009010fbf
4 changed files with 96 additions and 88 deletions

View File

@@ -127,6 +127,22 @@ struct uverbs_root_spec {
struct uverbs_object_spec_hash *object_buckets[0];
};
/*
* =======================================
* Verbs definitions
* =======================================
*/
struct uverbs_object_def {
const struct uverbs_obj_type *type_attrs;
};
#define _UVERBS_OBJECT(_id, _type_attrs, ...) \
((const struct uverbs_object_def) { \
.type_attrs = _type_attrs})
#define DECLARE_UVERBS_OBJECT(_name, _id, _type_attrs, ...) \
const struct uverbs_object_def _name = \
_UVERBS_OBJECT(_id, _type_attrs, ##__VA_ARGS__)
/* =================================================
* Parsing infrastructure
* =================================================