[ovs-dev] [PATCH 11/13] log: Replace ovsdb_log_get_offset() by a more abstract mechanism.

Ben Pfaff blp at ovn.org
Mon Dec 25 02:13:23 UTC 2017


On Sat, Dec 23, 2017 at 05:30:59PM -0700, Justin Pettit wrote:
> 
> > On Dec 7, 2017, at 5:12 PM, Ben Pfaff <blp at ovn.org> wrote:
> > 
> > +/* Returns true if 'log' has grown enough above the base that it's worthwhile
> > + * to compact it, false otherwise. */
> > +bool
> > +ovsdb_log_has_grown(const struct ovsdb_log *log)
> 
> This name seems a bit misleading, since it just sounds like it's just
> grown as opposed to grown to a sufficient size.  What about something
> like ovsdb_log_should_compact()?

I intentionally avoided that name because there are additional criteria
for when a database should be compacted.

I changed the name to ovsdb_log_grew_lots().  Maybe that is clearer.

> > diff --git a/ovsdb/log.h b/ovsdb/log.h
> > index 4b74ca11ce6a..e68e922f871a 100644
> > --- a/ovsdb/log.h
> > +++ b/ovsdb/log.h
> > @@ -16,6 +16,25 @@
> > #ifndef OVSDB_LOG_H
> > #define OVSDB_LOG_H 1
> > 
> > +/* OVSDB log.
> > + *
> > + * A log consists of a series of records.  After opening or creating a log with
> > + * ovsdb_log_open(), the client may use ovsdb_log_read() to read any existing
> > + * records, one by one.  The client may also use ovsdb_log_write() to write new
> > + * records (if some records have not yet been read at this point, then the
> > + * first write truncates them).
> 
> It might be nice to add some of this information to the functions themselves.

Good idea, I added some comments.

> Acked-by: Justin Pettit <jpettit at ovn.org>

Thanks, applied to master with those changes.


More information about the dev mailing list