ofproto-dpif: Use a regular ref instead of try_ref for rule translation.
authorBen Pfaff <blp@nicira.com>
Sun, 2 Aug 2015 18:51:32 +0000 (11:51 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 3 Aug 2015 23:43:46 +0000 (16:43 -0700)
commit1e1e1d19e6bbe9d3ca5f31ebf3e4362b4306562e
tree4a79ad0122e7d445da793b1abf3f28d5068d1854
parent5868eb242b73fc90c690d9894f258e16de450eee
ofproto-dpif: Use a regular ref instead of try_ref for rule translation.

Until now, flow translation has had to use try_ref to take a reference on
a rule, because a competing thread might have released the last reference
and done an RCU-postponed deletion.  Since classifier versioning was
introduced, however, the release of the last reference is itself
RCU-postponed, which means that it is always safe to take the reference
directly.

Changing try_ref to ref means that taking a reference can't fail, which
allows the caller to take a reference in cases where the need to take a
reference was previously passed along a call chain, which simplifies some
code.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
ofproto/ofproto-dpif-xlate.c
ofproto/ofproto-dpif.c
ofproto/ofproto-dpif.h