[ovs-dev] [PATCH 2/2] ovsdb: Return NULL if prev_txn == next_txn

Liran Schour lirans at il.ibm.com
Sat Feb 20 16:35:50 UTC 2016


In case that we flushed everything already, we can immeidately return NULL.

Signed-off-by: Liran Schour <lirans at il.ibm.com>
---
 ovsdb/monitor.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ovsdb/monitor.c b/ovsdb/monitor.c
index 5ae9cdb..1a07f19 100644
--- a/ovsdb/monitor.c
+++ b/ovsdb/monitor.c
@@ -733,6 +733,10 @@ ovsdb_monitor_get_update(struct ovsdb_monitor *dbmon,
     uint64_t prev_txn = *unflushed;
     uint64_t next_txn = dbmon->n_transactions + 1;
 
+    if (prev_txn == next_txn) {
+        return NULL;
+    }
+
     /* Return a clone of cached json if one exists. Otherwise,
      * generate a new one and add it to the cache.  */
     cache_node = ovsdb_monitor_json_cache_search(dbmon, version, prev_txn);
-- 
2.1.4





More information about the dev mailing list