diff options
author | Ben Pfaff <blp@ovn.org> | 2017-12-07 14:33:28 -0800 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2017-12-24 11:56:42 -0800 |
commit | 421fc8a1359e50049c1509bc920e64e6591dc925 (patch) | |
tree | df887a47fb202943ffaf6a95aac688fcf3ff3325 /ovsdb/log.h | |
parent | 875f8c13cb401e55fb02c200f8b3febc7d2ac9b6 (diff) | |
download | openvswitch-421fc8a1359e50049c1509bc920e64e6591dc925.tar.gz |
log: New functions for replacing a log's contents.
These functions will acquire users in future commits.
This new functionality made the internal state machine of the log hard
enough to understand that I thought that it was best to make it explicit
with a 'state' variable, so this commit introduces one.
This commit duplicates code and logic from ovsdb_rename() and
ovsdb_compact() in ovsdb/file.c. A future commit removes this duplication.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Justin Pettit <jpettit@ovn.org>
Diffstat (limited to 'ovsdb/log.h')
-rw-r--r-- | ovsdb/log.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ovsdb/log.h b/ovsdb/log.h index a6cba58e1..cc8469c01 100644 --- a/ovsdb/log.h +++ b/ovsdb/log.h @@ -53,4 +53,18 @@ struct ovsdb_error *ovsdb_log_commit(struct ovsdb_log *) off_t ovsdb_log_get_offset(const struct ovsdb_log *); +struct ovsdb_error *ovsdb_log_replace(struct ovsdb_log *, + struct json **entries, size_t n) + OVS_WARN_UNUSED_RESULT; +struct ovsdb_error *ovsdb_log_replace_start(struct ovsdb_log *old, + struct ovsdb_log **newp) + OVS_WARN_UNUSED_RESULT; +struct ovsdb_error *ovsdb_log_replace_commit(struct ovsdb_log *old, + struct ovsdb_log *new) + OVS_WARN_UNUSED_RESULT; +void ovsdb_log_replace_abort(struct ovsdb_log *new); + +/* For testing. */ +void ovsdb_log_disable_renaming_open_files(void); + #endif /* ovsdb/log.h */ |