tdb_chainlock() in tdb1, tdb2 and tdb_compat ?

Volker Lendecke Volker.Lendecke at SerNet.DE
Fri Apr 13 02:50:15 MDT 2012

On Fri, Apr 13, 2012 at 10:41:10AM +0200, Michael Adam wrote:
> I understand that there is a real problem with the
> sublte difference in signature and return semantics for
> tdb_chainlock.
> There can always be new callers that check == -1 instead of < 0,
> so I think the best way would have been to have a compat
> version for these, too, so that the difference is explicit.
> I also think simo's proposal was quite reasonable,
> but the middle course might be to consequently use the compat
> layer for such functions as chainlock for which the compiler does
> not complain about differences (at least the C compiler...).
> For the demand of samba3 still being able to link against
> system libtdb (version 1.X), couldn't we introduce tdb into
> libreplace and do some #define trickts? ...

Different proposal: Rename tdb2 to tdb3 and introduce a tdb2
version that matches exactly tdb1 code with 2 changes:
tdb_off_t is uint64 and the freelist becomes a doubly linked
list. This way we solve the two pressing tdb1 problems
without a lot of the hassle that tdb2's semantic changes
bring. I checked: tdb_off_t does not leak into the published
API. We would probably limit a single record to 4GB, but I
doubt this is a real issue.

With best regards,

Volker Lendecke

SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen, mailto:kontakt at

More information about the samba-technical mailing list