diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-12-16 14:38:17 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-12-16 14:38:17 +1100 |
commit | 936d76802f98d04d9743b2ca8eeeaadd4362db51 (patch) | |
tree | 42bc48667e84e7fc016af2ca3130b33d5d6c7b6a /lib/tdb/include | |
parent | 2e4247782bd5812bc8e7ea24194c8436748bb2fa (diff) | |
download | samba-936d76802f98d04d9743b2ca8eeeaadd4362db51.tar.gz samba-936d76802f98d04d9743b2ca8eeeaadd4362db51.tar.bz2 samba-936d76802f98d04d9743b2ca8eeeaadd4362db51.zip |
imported the tdb_repack() code from CTDB
The tdb_repack() function repacks a TDB so that it has a single
freelist entry. The file doesn't shrink, but it does remove all
freelist fragmentation. This code originated in the CTDB vacuuming
code, but will now be used in ldb to cope with fragmentation from
re-indexing
Diffstat (limited to 'lib/tdb/include')
-rw-r--r-- | lib/tdb/include/tdb.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h index c41c9941f0..94b5e366b9 100644 --- a/lib/tdb/include/tdb.h +++ b/lib/tdb/include/tdb.h @@ -152,11 +152,14 @@ int tdb_chainlock_unmark(struct tdb_context *tdb, TDB_DATA key); void tdb_setalarm_sigptr(struct tdb_context *tdb, volatile sig_atomic_t *sigptr); +/* wipe and repack */ +int tdb_wipe_all(struct tdb_context *tdb); +int tdb_repack(struct tdb_context *tdb); + /* Debug functions. Not used in production. */ void tdb_dump_all(struct tdb_context *tdb); int tdb_printfreelist(struct tdb_context *tdb); int tdb_validate_freelist(struct tdb_context *tdb, int *pnum_entries); -int tdb_wipe_all(struct tdb_context *tdb); int tdb_freelist_size(struct tdb_context *tdb); extern TDB_DATA tdb_null; |