[ovs-dev] [PATCH 06/10] object-collection: Remove access to stub.
Jarno Rajahalme
jarno at ovn.org
Thu Aug 18 22:50:19 UTC 2016
Better not use access to the *_collection_stub(), as it is an internal
implementation detail.
Signed-off-by: Jarno Rajahalme <jarno at ovn.org>
---
lib/object-collection.h | 5 -----
ofproto/ofproto.c | 10 +++++-----
2 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/lib/object-collection.h b/lib/object-collection.h
index a0ad0f2..4903451 100644
--- a/lib/object-collection.h
+++ b/lib/object-collection.h
@@ -78,11 +78,6 @@ static inline TYPE* NAME##_collection_##NAME##s(const struct NAME##_collection *
return (TYPE*)coll->collection.objs; \
} \
\
-static inline TYPE* NAME##_collection_stub(struct NAME##_collection *coll) \
-{ \
- return (TYPE*)coll->collection.stub; \
-} \
- \
static inline size_t NAME##_collection_n(const struct NAME##_collection *coll) \
{ \
return coll->collection.n; \
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 6adb1a4..fd298d6 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -4764,7 +4764,7 @@ add_flow_start(struct ofproto *ofproto, struct ofproto_flow_mod *ofm)
rule_collection_add(&ofm->old_rules, old_rule);
}
/* Take ownership of the temp_rule. */
- rule_collection_stub(&ofm->new_rules)[0] = new_rule;
+ rule_collection_add(&ofm->new_rules, new_rule);
ofm->temp_rule = NULL;
replace_rule_start(ofproto, ofm, old_rule, new_rule);
@@ -4777,8 +4777,8 @@ add_flow_revert(struct ofproto *ofproto, struct ofproto_flow_mod *ofm)
OVS_REQUIRES(ofproto_mutex)
{
struct rule *old_rule = rule_collection_n(&ofm->old_rules)
- ? rule_collection_stub(&ofm->old_rules)[0] : NULL;
- struct rule *new_rule = rule_collection_stub(&ofm->new_rules)[0];
+ ? rule_collection_rules(&ofm->old_rules)[0] : NULL;
+ struct rule *new_rule = rule_collection_rules(&ofm->new_rules)[0];
replace_rule_revert(ofproto, old_rule, new_rule);
}
@@ -4790,8 +4790,8 @@ add_flow_finish(struct ofproto *ofproto, struct ofproto_flow_mod *ofm,
OVS_REQUIRES(ofproto_mutex)
{
struct rule *old_rule = rule_collection_n(&ofm->old_rules)
- ? rule_collection_stub(&ofm->old_rules)[0] : NULL;
- struct rule *new_rule = rule_collection_stub(&ofm->new_rules)[0];
+ ? rule_collection_rules(&ofm->old_rules)[0] : NULL;
+ struct rule *new_rule = rule_collection_rules(&ofm->new_rules)[0];
struct ovs_list dead_cookies = OVS_LIST_INITIALIZER(&dead_cookies);
replace_rule_finish(ofproto, ofm, req, old_rule, new_rule, &dead_cookies);
--
2.1.4
More information about the dev
mailing list