+struct bfd *
+bfd_ref(const struct bfd *bfd_)
+{
+ struct bfd *bfd = CONST_CAST(struct bfd *, bfd_);
+ if (bfd) {
+ ovs_assert(bfd->ref_cnt > 0);
+ bfd->ref_cnt++;
+ }
+ return bfd;
+}
+
+void
+bfd_unref(struct bfd *bfd)
+{
+ if (bfd) {
+ ovs_assert(bfd->ref_cnt > 0);
+ if (!--bfd->ref_cnt) {
+ hmap_remove(&all_bfds, &bfd->node);
+ free(bfd->name);
+ free(bfd);
+ }
+ }
+}
+