tdb: add tdb_freelist_merge_adjacent()
authorMichael Adam <obnox@samba.org>
Mon, 10 Feb 2014 01:39:09 +0000 (02:39 +0100)
committerVolker Lendecke <vl@samba.org>
Thu, 26 Jun 2014 08:00:11 +0000 (10:00 +0200)
commit843a8a5c7b82459fae2eee490da005a68e4ced91
treeec2899f4139ace2e548ca3af45bd1ccdc21b90ce
parent73c439f5818c40582892c1170ab8b21fb4f59c6d
tdb: add tdb_freelist_merge_adjacent()

This is intended to be called to reduce the fragmentation in the
freelist. This is to make up the deficiency of the freelist
to be not doubly linked. If the freelist were doubly linked,
we could easily avoid the creation of adjacent freelist entries.
But with the current singly linked list, it is only possible
to cheaply merge a new free record into a freelist entry on the left,
not on the right...

This can be called periodically, e.g. in the vacuuming process
of a ctdb cluster.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
lib/tdb/common/freelist.c