Re: [PATCH v3 19/20] refs: add LMDB refs backend
On Thu, 2016-02-04 at 16:58 +0700, Duy Nguyen wrote:
Show 39 quoted lines
> On Thu, Jan 14, 2016 at 11:26 PM, David Turner <
> dturner@twopensource.com> wrote:
> > diff --git a/refs/lmdb-backend.c b/refs/lmdb-backend.c
> > new file mode 100644
> > index 0000000..470c79f
> > --- /dev/null
> > +++ b/refs/lmdb-backend.c
> > @@ -0,0 +1,2051 @@
> > +/*
> > + * This file implements a lmdb backend for refs.
> > + *
> > + * The design of this backend relies on lmdb's write lock -- that
> > is, any
> > + * write transaction blocks all other writers. Thus, as soon as a
> > ref
> > + * transaction is opened, we know that any values we read won't
> > + * change out from under us, and we have a fully-consistent view
> > of the
> > + * database.
> > + *
> > + * We store the content of refs including the trailing \0 so that
> > + * standard C string functions can handle them. Just like struct
> > + * strbuf.
> > + */
> > +#include "../cache.h"
> > +#include <lmdb.h>
> > +#include "../object.h"
> > +#include "../refs.h"
> > +#include "refs-internal.h"
> > +#include "../tag.h"
> > +#include "../lockfile.h"
> > +
> > +static struct trace_key db_trace = TRACE_KEY_INIT(LMDB);
>
> Super nit:
>
> CC refs/lmdb-backend.o
> refs/lmdb-backend.c:22:25: cảnh báo: ‘db_trace’ defined but not used
> [-Wunused-variable]