return NULL;
}
-
-/* This is probably not the function you want. Use ovsdb_txn_row_modify()
- * instead. */
-bool
-ovsdb_table_put_row(struct ovsdb_table *table, struct ovsdb_row *row)
-{
- const struct uuid *uuid = ovsdb_row_get_uuid(row);
- if (!ovsdb_table_get_row(table, uuid)) {
- hmap_insert(&table->rows, &row->hmap_node, uuid_hash(uuid));
- return true;
- } else {
- return false;
- }
-}
const struct ovsdb_row *ovsdb_table_get_row(const struct ovsdb_table *,
const struct uuid *);
-bool ovsdb_table_put_row(struct ovsdb_table *, struct ovsdb_row *);
#endif /* ovsdb/table.h */
ovsdb_table_destroy(table); /* Also destroys 'ts'. */
}
+/* Inserts a row, without bothering to update metadata such as refcounts. */
+static void
+put_row(struct ovsdb_table *table, struct ovsdb_row *row)
+{
+ const struct uuid *uuid = ovsdb_row_get_uuid(row);
+ if (!ovsdb_table_get_row(table, uuid)) {
+ hmap_insert(&table->rows, &row->hmap_node, uuid_hash(uuid));
+ }
+}
+
struct do_query_cbdata {
struct uuid *row_uuids;
int *counts;
UUID_ARGS(ovsdb_row_get_uuid(row)));
}
cbdata.row_uuids[i] = *ovsdb_row_get_uuid(row);
- ovsdb_table_put_row(table, row);
+ put_row(table, row);
}
json_destroy(json);
ovs_fatal(0, "duplicate UUID "UUID_FMT" in table",
UUID_ARGS(ovsdb_row_get_uuid(row)));
}
- ovsdb_table_put_row(table, row);
+ put_row(table, row);
}
json_destroy(json);