summaryrefslogtreecommitdiff
path: root/lib/tdb2/tdb2.h
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-09-14 08:03:13 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-09-14 08:03:13 +0930
commita15c1cf175d7f29a50d7b2c1acb0f67faab1b06f (patch)
tree63ed869da6d1608a97b1b6ae73984e48b5157e80 /lib/tdb2/tdb2.h
parenta347a4802695c41437e2966404d1e2fe2dee78b4 (diff)
downloadsamba-a15c1cf175d7f29a50d7b2c1acb0f67faab1b06f.tar.gz
samba-a15c1cf175d7f29a50d7b2c1acb0f67faab1b06f.tar.bz2
samba-a15c1cf175d7f29a50d7b2c1acb0f67faab1b06f.zip
tdb2: tdb_repack
Move the tdb1_repack() code into the core, make it general, rename to tdb_repack(). It's generic code: copy database into temporary, wipe it, copy back. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (Imported from CCAN commit e487983a4099b6f760056ff7182f2ff543e6da71)
Diffstat (limited to 'lib/tdb2/tdb2.h')
-rw-r--r--lib/tdb2/tdb2.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/tdb2/tdb2.h b/lib/tdb2/tdb2.h
index 7967b60f7b..ebfc918404 100644
--- a/lib/tdb2/tdb2.h
+++ b/lib/tdb2/tdb2.h
@@ -508,6 +508,16 @@ void tdb_unlockall_read(struct tdb_context *tdb);
enum TDB_ERROR tdb_wipe_all(struct tdb_context *tdb);
/**
+ * tdb_repack - repack the database
+ * @tdb: the tdb context returned from tdb_open()
+ *
+ * This repacks the database; if it is suffering from a great deal of
+ * fragmentation this might help. However, it can take twice the
+ * memory of the existing TDB.
+ */
+enum TDB_ERROR tdb_repack(struct tdb_context *tdb);
+
+/**
* tdb_check - check a TDB for consistency
* @tdb: the tdb context returned from tdb_open()
* @check: function to check each key/data pair (or NULL)