diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-10-12 23:01:08 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-10-13 14:06:07 +0200 |
commit | 01c934c81e55b79601122d8e0740c7946077c37e (patch) | |
tree | f6e7909690bc399c3036ef80e22997aadbf88884 /source3/lib/dbwrap | |
parent | 3cdb1fe4404e26ae383cfb73bfa8af36cb1d7f7c (diff) | |
download | samba-01c934c81e55b79601122d8e0740c7946077c37e.tar.gz samba-01c934c81e55b79601122d8e0740c7946077c37e.tar.bz2 samba-01c934c81e55b79601122d8e0740c7946077c37e.zip |
lib/util: Add back control of mmap and hash size in tdb for top level build
This passes down a struct loadparm_context to allow these
parameters to be checked. This may be s3 or s4 context, allowing the
#if _SAMBA_BUILD_ macro to go away safely.
Andrew Bartlett
Diffstat (limited to 'source3/lib/dbwrap')
-rw-r--r-- | source3/lib/dbwrap/dbwrap_tdb.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/lib/dbwrap/dbwrap_tdb.c b/source3/lib/dbwrap/dbwrap_tdb.c index 4330c961ec..e9e4900068 100644 --- a/source3/lib/dbwrap/dbwrap_tdb.c +++ b/source3/lib/dbwrap/dbwrap_tdb.c @@ -22,6 +22,7 @@ #include "dbwrap/dbwrap_private.h" #include "dbwrap/dbwrap_tdb.h" #include "lib/util/tdb_wrap.h" +#include "lib/param/param.h" struct db_tdb_ctx { struct tdb_wrap *wtdb; @@ -359,12 +360,14 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx, { struct db_context *result = NULL; struct db_tdb_ctx *db_tdb; - + struct loadparm_context *lp_ctx; + result = talloc_zero(mem_ctx, struct db_context); if (result == NULL) { DEBUG(0, ("talloc failed\n")); goto fail; } + lp_ctx = loadparm_init_s3(result, loadparm_s3_context()); result->private_data = db_tdb = talloc(result, struct db_tdb_ctx); if (db_tdb == NULL) { @@ -373,7 +376,8 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx, } db_tdb->wtdb = tdb_wrap_open(db_tdb, name, hash_size, tdb_flags, - open_flags, mode); + open_flags, mode, lp_ctx); + talloc_unlink(result, lp_ctx); if (db_tdb->wtdb == NULL) { DEBUG(3, ("Could not open tdb: %s\n", strerror(errno))); goto fail; |