summaryrefslogtreecommitdiffstats
path: root/source3/smbd/reply.c
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2014-03-19 13:38:17 +0100
committerMichael Adam <obnox@samba.org>2014-04-09 10:37:08 +0200
commitd9566085c68b9da6d46a5916a6cca33ca03befce (patch)
tree7bda82a928c33e1251275f5a33bb66de33d4197b /source3/smbd/reply.c
parent1e1b7b1021b16e3ab61c2fca8328c94e60a2c99c (diff)
downloadsamba-d9566085c68b9da6d46a5916a6cca33ca03befce.tar.gz
samba-d9566085c68b9da6d46a5916a6cca33ca03befce.tar.xz
samba-d9566085c68b9da6d46a5916a6cca33ca03befce.zip
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
Diffstat (limited to 'source3/smbd/reply.c')
0 files changed, 0 insertions, 0 deletions