summaryrefslogtreecommitdiff
path: root/lib/tdb_wrap
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tdb_wrap')
-rw-r--r--lib/tdb_wrap/tdb_wrap.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/lib/tdb_wrap/tdb_wrap.c b/lib/tdb_wrap/tdb_wrap.c
index 312d17fe961..4b5b8f2b608 100644
--- a/lib/tdb_wrap/tdb_wrap.c
+++ b/lib/tdb_wrap/tdb_wrap.c
@@ -88,8 +88,7 @@ static struct tdb_wrap_private *tdb_wrap_private_open(TALLOC_CTX *mem_ctx,
int hash_size,
int tdb_flags,
int open_flags,
- mode_t mode,
- struct loadparm_context *lp_ctx)
+ mode_t mode)
{
struct tdb_wrap_private *result;
struct tdb_logging_context lctx;
@@ -103,22 +102,6 @@ static struct tdb_wrap_private *tdb_wrap_private_open(TALLOC_CTX *mem_ctx,
goto fail;
}
- if (!lpcfg_use_mmap(lp_ctx)) {
- tdb_flags |= TDB_NOMMAP;
- }
-
- if ((hash_size == 0) && (name != NULL)) {
- const char *base;
- base = strrchr_m(name, '/');
-
- if (base != NULL) {
- base += 1;
- } else {
- base = name;
- }
- hash_size = lpcfg_parm_int(lp_ctx, NULL, "tdb_hashsize", base, 0);
- }
-
lctx.log_fn = tdb_wrap_log;
lctx.log_private = NULL;
@@ -167,8 +150,25 @@ struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx,
}
if (w == NULL) {
+ if (!lpcfg_use_mmap(lp_ctx)) {
+ tdb_flags |= TDB_NOMMAP;
+ }
+
+ if ((hash_size == 0) && (name != NULL)) {
+ const char *base;
+ base = strrchr_m(name, '/');
+
+ if (base != NULL) {
+ base += 1;
+ } else {
+ base = name;
+ }
+ hash_size = lpcfg_parm_int(lp_ctx, NULL,
+ "tdb_hashsize", base, 0);
+ }
+
w = tdb_wrap_private_open(result, name, hash_size, tdb_flags,
- open_flags, mode, lp_ctx);
+ open_flags, mode);
} else {
/*
* Correctly use talloc_reference: The tdb will be