diff options
author | Volker Lendecke <vl@samba.org> | 2014-03-26 13:32:16 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2014-03-31 22:52:13 +0200 |
commit | ccec132502586ce5dd93617dd92d9e117b703cc1 (patch) | |
tree | e245b9a572a59946bf8ee95d1d1a7e8af3183ad5 | |
parent | a9ebe2f71a067fac0b0dd1187037e820283077b9 (diff) | |
download | samba-ccec132502586ce5dd93617dd92d9e117b703cc1.tar.gz samba-ccec132502586ce5dd93617dd92d9e117b703cc1.tar.xz samba-ccec132502586ce5dd93617dd92d9e117b703cc1.zip |
lib: Pull up lp_ctx use one level
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r-- | lib/tdb_wrap/tdb_wrap.c | 38 |
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 |