+static struct ovsdb_error * WARN_UNUSED_RESULT
+check_max_rows(struct ovsdb_txn *txn)
+{
+ struct ovsdb_txn_table *t;
+
+ LIST_FOR_EACH (t, node, &txn->txn_tables) {
+ size_t n_rows = hmap_count(&t->table->rows);
+ unsigned int max_rows = t->table->schema->max_rows;
+
+ if (n_rows > max_rows) {
+ return ovsdb_error("constraint violation",
+ "transaction causes \"%s\" table to contain "
+ "%zu rows, greater than the schema-defined "
+ "limit of %u row(s)",
+ t->table->schema->name, n_rows, max_rows);
+ }
+ }
+
+ return NULL;
+}
+