From: Duy Nguyen Date: Thu, 04 Feb 2016 09:58:31 GMT Subject: Re: [PATCH v3 19/20] refs: add LMDB refs backend Message-ID: In-Reply-To: <1452788777-24954-20-git-send-email-dturner@twopensource.com> On Thu, Jan 14, 2016 at 11:26 PM, David Turner 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 > +#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] -- Duy