@@ -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; \
@@ -4692,7 +4692,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);
@@ -4705,8 +4705,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);
}
@@ -4718,8 +4718,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);
Better not use access to the *_collection_stub(), as it is an internal implementation detail. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> --- lib/object-collection.h | 5 ----- ofproto/ofproto.c | 10 +++++----- 2 files changed, 5 insertions(+), 10 deletions(-)