1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
samba-mirror/lib/tdb
Michael Adam d9566085c6 tdb: consolidate tdb allocation code - re-use dead records at hash top.
When in tdb_store we re-use a dead record reactivated from the
target hash chain itself, we currently leave it in its place in
the chain. When we re-use a dead record from a different chain or
from the freelist instead, we insert it at the beginning of the
target chain.

This patch changes the behaviour to always newly store a
record at the beginning of the hash chain. This removes
a special case and hence simplifies the allocation code.
On the other hand side, it introduces two additioal tdb_ofs_write
calls for the in-chain-case.

Note the subtelty of the patch that by moving the case of the candidate
record's chain as new case "i=0" into the for loop, we also reverse the
order of the two steps in the for-loop body (non blocking freelist alloc
and searching for dead record in a chain) in order to keep the overall
order of execution identical.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Apr  9 10:37:08 CEST 2014 on sn-devel-104
2014-04-09 10:37:08 +02:00
..
ABI tdb: change version to 1.2.13. 2014-03-18 15:42:48 +01:00
common tdb: consolidate tdb allocation code - re-use dead records at hash top. 2014-04-09 10:37:08 +02:00
docs tdb: Fix some typos in comments. 2013-09-12 13:54:41 +02:00
include tdb: Fix some typos in comments. 2013-09-12 13:54:41 +02:00
man tdb: Fix typos. 2013-06-07 15:18:47 +02:00
python tdb tests: Remove custom code for "tdb2", which has been split out into ntdb. 2013-12-06 05:21:03 +01:00
test tdb/test: avoid const warnings by using 'discard_const_p(uint8_t,' instead of '(void *)' 2014-04-02 09:03:42 +02:00
tools tdb/tools: avoid const warnings in tdbdump.c 2014-04-02 09:03:42 +02:00
web Update tdb and talloc web pages 2009-05-05 19:04:39 -04:00
configure tdb: Remove autotools support. 2010-12-24 01:15:05 +01:00
doxy.config doc: Remove build/ from doxygen config or it will not work in brew. 2012-08-04 16:31:22 +02:00
Makefile tdb: import unit tests from CCAN into tdb/test/ 2012-02-14 04:05:43 +10:30
pytdb.c samba:python - Py_RETURN_NONE remove compatibility code for releases < 2.4 2014-01-09 16:27:47 +01:00
tdb.pc.in s4-pkgconfig: add @LIB_RPATH@ to our link flags 2010-12-08 12:46:00 +01:00
wscript tdb/wscript: maintain a global list of unit tests 2014-04-02 09:03:42 +02:00