summaryrefslogtreecommitdiff
path: root/lib/tdb_compat/tdb_compat.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2011-09-21 12:56:59 +0930
committerRusty Russell <rusty@rustcorp.com.au>2011-09-21 12:56:59 +0930
commit10e6a3282098b3d4d94e72fa27f47825ef4e7f15 (patch)
treedd3241223613b323ea28231258caa0776032bb50 /lib/tdb_compat/tdb_compat.c
parent36b455d95227f8ef2f08e3134e289b2862b319f9 (diff)
downloadsamba-10e6a3282098b3d4d94e72fa27f47825ef4e7f15.tar.gz
samba-10e6a3282098b3d4d94e72fa27f47825ef4e7f15.tar.bz2
samba-10e6a3282098b3d4d94e72fa27f47825ef4e7f15.zip
tdb_compat: handle TDB_VOLATILE flag.
This is only meaningful when using the TDB_VERSION1 flag: we set the attribute to control the maximum number of dead records (to 5, which is what TDB_VOLATILE did for tdb1). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/tdb_compat/tdb_compat.c')
-rw-r--r--lib/tdb_compat/tdb_compat.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/tdb_compat/tdb_compat.c b/lib/tdb_compat/tdb_compat.c
index 9ed6604c4d..f311b4bfba 100644
--- a/lib/tdb_compat/tdb_compat.c
+++ b/lib/tdb_compat/tdb_compat.c
@@ -94,7 +94,7 @@ tdb_open_compat_(const char *name, int hash_size_unused,
void *data),
void *log_data)
{
- union tdb_attribute cif, log, hash, *attr = NULL;
+ union tdb_attribute cif, log, hash, max_dead, *attr = NULL;
if (log_fn) {
log.log.base.attr = TDB_ATTRIBUTE_LOG;
@@ -122,6 +122,16 @@ tdb_open_compat_(const char *name, int hash_size_unused,
tdb_flags &= ~TDB_INCOMPATIBLE_HASH;
}
+ if (tdb_flags & TDB_VOLATILE) {
+ if (tdb_flags & TDB_VERSION1) {
+ max_dead.base.attr = TDB_ATTRIBUTE_TDB1_MAX_DEAD;
+ max_dead.base.next = attr;
+ max_dead.tdb1_max_dead.max_dead = 5;
+ attr = &max_dead;
+ }
+ tdb_flags &= ~TDB_VOLATILE;
+ }
+
/* Testsuite uses this to speed things up. */
if (getenv("TDB_NO_FSYNC")) {
tdb_flags |= TDB_NOSYNC;