summaryrefslogtreecommitdiff
path: root/ovsdb/row.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-02-08 14:09:41 -0800
committerBen Pfaff <blp@nicira.com>2010-02-08 14:16:19 -0800
commit0d0f05b909b6428d44eb147bd4edd73782d2a137 (patch)
treec64d595c7df2281b6a69d00dc2a4f73d37986a40 /ovsdb/row.h
parentbd76d25d8b3b7d11c5a326e91d784ad2cdeecd45 (diff)
downloadopenvswitch-0d0f05b909b6428d44eb147bd4edd73782d2a137.tar.gz
ovsdb: Add support for referential integrity in the database itself.
Diffstat (limited to 'ovsdb/row.h')
-rw-r--r--ovsdb/row.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/ovsdb/row.h b/ovsdb/row.h
index 55c4f1426..d468194a4 100644
--- a/ovsdb/row.h
+++ b/ovsdb/row.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2009 Nicira Networks
+/* Copyright (c) 2009, 2010 Nicira Networks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -29,6 +29,13 @@ struct ovsdb_row {
struct ovsdb_table *table; /* Table to which this belongs. */
struct hmap_node hmap_node; /* Element in ovsdb_table's 'rows' hmap. */
struct ovsdb_txn_row *txn_row; /* Transaction that row is in, if any. */
+
+ /* Number of refs to this row from other rows, in this table or other
+ * tables, through 'uuid' columns that have a 'refTable' constraint
+ * pointing to this table. A row with nonzero 'n_refs' cannot be deleted.
+ * Updated and checked only at transaction commit. */
+ size_t n_refs;
+
struct ovsdb_datum fields[];
};