r10253: a fairly large tdb cleanup and re-organise. Nearly all of this change
authorAndrew Tridgell <tridge@samba.org>
Fri, 16 Sep 2005 03:52:42 +0000 (03:52 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:38:12 +0000 (13:38 -0500)
commit0868b7c77d42efd5f361f605bfc0d8d46841db95
treee73b6ca6bb895ff3b9af1006ffd566e7f2ee7ea8
parent95040e934175eb877ce6d83690fd06ce5d2b028c
r10253: a fairly large tdb cleanup and re-organise. Nearly all of this change
just involves splitting up the core tdb.c code into separate files on
logical boundaries, but there are some minor functional changes as well:

 - move the 'struct tdb_context' into tdb_private.h, hiding it from
   users. This was done to allow the structure to change without
   breaking code that uses tdb.

 - added accessor functions tdb_fd(), tdb_name(), and tdb_log_fn() to
   access the elements of struct tdb_context that were used by
   external code but are no longer visible

 - simplied tdb_append() to use tdb_fetch()/tdb_store(), which is just
   as good due to the way tdb locks work

 - changed some of the types (such as tdb_off to tdb_off_t) to make
   syntax highlighting work better

 - removed the old optional spinlock code. It was a bad idea.

 - fixed a bug in tdb_reopen_all() that caused tdbtorture to sometimes
   fail or report nasty looking errors. This is the only real bug
   fixed in this commit. Jeremy/Jerry, you might like to pickup this
   change for Samba3, as that could definately affect smbd in
   Samba3.

The aim of all of these changes is to make the tdb
transactions/journaling code I am working on easier to write. I
started to write it on top of the existing tdb.c code and it got very
messy. Splitting up the code makes it much easier to follow.

There are more cleanups we could do in tdb, such as using uint32_t
instead of u32 (suggested by metze). I'll leave those for another day.
(This used to be commit 4673cdd0d261614e707b72a7a348bb0e7dbb2482)
26 files changed:
source4/lib/db_wrap.c
source4/lib/ldb/ldb_tdb/ldb_tdb_wrap.c
source4/lib/tdb/Makefile.in
source4/lib/tdb/autogen.sh
source4/lib/tdb/common/dump.c [new file with mode: 0644]
source4/lib/tdb/common/error.c [new file with mode: 0644]
source4/lib/tdb/common/freelist.c [new file with mode: 0644]
source4/lib/tdb/common/io.c [new file with mode: 0644]
source4/lib/tdb/common/lock.c [new file with mode: 0644]
source4/lib/tdb/common/open.c [new file with mode: 0644]
source4/lib/tdb/common/spinlock.c [deleted file]
source4/lib/tdb/common/tdb.c
source4/lib/tdb/common/tdb_private.h [new file with mode: 0644]
source4/lib/tdb/common/tdbutil.c
source4/lib/tdb/common/traverse.c [new file with mode: 0644]
source4/lib/tdb/config.m4
source4/lib/tdb/config.mk
source4/lib/tdb/configure.in
source4/lib/tdb/include/spinlock.h [deleted file]
source4/lib/tdb/include/tdb.h
source4/lib/tdb/include/tdbconfig.h.in [new file with mode: 0644]
source4/lib/tdb/include/tdbutil.h
source4/lib/tdb/tools/tdbdump.c
source4/lib/tdb/tools/tdbtest.c
source4/lib/tdb/tools/tdbtool.c
source4/lib/tdb/tools/tdbtorture.c