git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Prepare for post-2.2.0 (2.2.90).
[sliver-openvswitch.git]
/
ovsdb
/
transaction.c
diff --git
a/ovsdb/transaction.c
b/ovsdb/transaction.c
index
cc890ad
..
be40df9
100644
(file)
--- a/
ovsdb/transaction.c
+++ b/
ovsdb/transaction.c
@@
-1,4
+1,4
@@
-/* Copyright (c) 2009, 2010, 2011, 2012 Nicira, Inc.
+/* Copyright (c) 2009, 2010, 2011, 2012
, 2013, 2014
Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-17,8
+17,6
@@
#include "transaction.h"
#include "transaction.h"
-#include <assert.h>
-
#include "bitmap.h"
#include "dynamic-string.h"
#include "hash.h"
#include "bitmap.h"
#include "dynamic-string.h"
#include "hash.h"
@@
-111,7
+109,7
@@
ovsdb_txn_create(struct ovsdb *db)
static void
ovsdb_txn_free(struct ovsdb_txn *txn)
{
static void
ovsdb_txn_free(struct ovsdb_txn *txn)
{
- assert(list_is_empty(&txn->txn_tables));
+
ovs_
assert(list_is_empty(&txn->txn_tables));
ds_destroy(&txn->comment);
free(txn);
}
ds_destroy(&txn->comment);
free(txn);
}
@@
-297,7
+295,7
@@
check_ref_count(struct ovsdb_txn *txn OVS_UNUSED, struct ovsdb_txn_row *r)
} else {
return ovsdb_error("referential integrity violation",
"cannot delete %s row "UUID_FMT" because "
} else {
return ovsdb_error("referential integrity violation",
"cannot delete %s row "UUID_FMT" because "
- "of %
zu
remaining reference(s)",
+ "of %
"PRIuSIZE"
remaining reference(s)",
r->table->schema->name, UUID_ARGS(&r->uuid),
r->n_refs);
}
r->table->schema->name, UUID_ARGS(&r->uuid),
r->n_refs);
}
@@
-535,6
+533,7
@@
assess_weak_refs(struct ovsdb_txn *txn, struct ovsdb_txn_row *txn_row)
}
if (datum->n != orig_n) {
}
if (datum->n != orig_n) {
+ bitmap_set1(txn_row->changed, OVSDB_COL_VERSION);
bitmap_set1(txn_row->changed, column->index);
ovsdb_datum_sort_assert(datum, column->type.key.type);
if (datum->n < column->type.n_min) {
bitmap_set1(txn_row->changed, column->index);
ovsdb_datum_sort_assert(datum, column->type.key.type);
if (datum->n < column->type.n_min) {
@@
-616,7
+615,7
@@
check_max_rows(struct ovsdb_txn *txn)
if (n_rows > max_rows) {
return ovsdb_error("constraint violation",
"transaction causes \"%s\" table to contain "
if (n_rows > max_rows) {
return ovsdb_error("constraint violation",
"transaction causes \"%s\" table to contain "
- "%
zu
rows, greater than the schema-defined "
+ "%
"PRIuSIZE"
rows, greater than the schema-defined "
"limit of %u row(s)",
t->table->schema->name, n_rows, max_rows);
}
"limit of %u row(s)",
t->table->schema->name, n_rows, max_rows);
}
@@
-655,7
+654,7
@@
duplicate_index_row__(const struct ovsdb_column_set *index,
ds_put_format(out, "%s row, with UUID "UUID_FMT", ",
title, UUID_ARGS(ovsdb_row_get_uuid(row)));
if (!row->txn_row
ds_put_format(out, "%s row, with UUID "UUID_FMT", ",
title, UUID_ARGS(ovsdb_row_get_uuid(row)));
if (!row->txn_row
- || bitmap_scan(row->txn_row->changed, 0, n_columns) == n_columns) {
+ || bitmap_scan(row->txn_row->changed,
1,
0, n_columns) == n_columns) {
ds_put_cstr(out, "existed in the database before this "
"transaction and was not modified by the transaction.");
} else if (!row->txn_row->old) {
ds_put_cstr(out, "existed in the database before this "
"transaction and was not modified by the transaction.");
} else if (!row->txn_row->old) {
@@
-807,7
+806,7
@@
ovsdb_txn_commit(struct ovsdb_txn *txn, bool durable)
if (error) {
/* We don't support two-phase commit so only the first replica is
* allowed to report an error. */
if (error) {
/* We don't support two-phase commit so only the first replica is
* allowed to report an error. */
- assert(&replica->node == txn->db->replicas.next);
+
ovs_
assert(&replica->node == txn->db->replicas.next);
ovsdb_txn_abort(txn);
return error;
ovsdb_txn_abort(txn);
return error;
@@
-898,7
+897,7
@@
ovsdb_txn_row_modify(struct ovsdb_txn *txn, const struct ovsdb_row *ro_row_)
struct ovsdb_row *ro_row = CONST_CAST(struct ovsdb_row *, ro_row_);
if (ro_row->txn_row) {
struct ovsdb_row *ro_row = CONST_CAST(struct ovsdb_row *, ro_row_);
if (ro_row->txn_row) {
- assert(ro_row == ro_row->txn_row->new);
+
ovs_
assert(ro_row == ro_row->txn_row->new);
return ro_row;
} else {
struct ovsdb_table *table = ro_row->table;
return ro_row;
} else {
struct ovsdb_table *table = ro_row->table;
@@
-940,7
+939,7
@@
ovsdb_txn_row_delete(struct ovsdb_txn *txn, const struct ovsdb_row *row_)
if (!txn_row) {
ovsdb_txn_row_create(txn, table, row, NULL);
} else {
if (!txn_row) {
ovsdb_txn_row_create(txn, table, row, NULL);
} else {
- assert(txn_row->new == row);
+
ovs_
assert(txn_row->new == row);
if (txn_row->old) {
txn_row->new = NULL;
} else {
if (txn_row->old) {
txn_row->new = NULL;
} else {
@@
-987,7
+986,7
@@
ovsdb_txn_table_destroy(struct ovsdb_txn_table *txn_table)
{
size_t i;
{
size_t i;
- assert(hmap_is_empty(&txn_table->txn_rows));
+
ovs_
assert(hmap_is_empty(&txn_table->txn_rows));
for (i = 0; i < txn_table->table->schema->n_indexes; i++) {
hmap_destroy(&txn_table->txn_indexes[i]);
for (i = 0; i < txn_table->table->schema->n_indexes; i++) {
hmap_destroy(&txn_table->txn_indexes[i]);