]> git.ozlabs.org Git - ccan/blobdiff - ccan/tdb2/tdb2.h
tdb2: tdb_repack
[ccan] / ccan / tdb2 / tdb2.h
index c91ca7cad08613d53e1bfa3f317f6197eea3db30..76ecbe5b9d7d59369063fe65b011ae0fc990ff99 100644 (file)
@@ -505,6 +505,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()