summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-10-12 23:01:08 +1100
committerAndrew Bartlett <abartlet@samba.org>2011-10-13 14:06:07 +0200
commit01c934c81e55b79601122d8e0740c7946077c37e (patch)
treef6e7909690bc399c3036ef80e22997aadbf88884 /source3/smbd
parent3cdb1fe4404e26ae383cfb73bfa8af36cb1d7f7c (diff)
downloadsamba-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/smbd')
-rw-r--r--source3/smbd/notify_internal.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source3/smbd/notify_internal.c b/source3/smbd/notify_internal.c
index 4f2749e17d..484a31c5be 100644
--- a/source3/smbd/notify_internal.c
+++ b/source3/smbd/notify_internal.c
@@ -32,6 +32,7 @@
#include "messages.h"
#include "lib/util/tdb_wrap.h"
#include "util_tdb.h"
+#include "lib/param/param.h"
struct notify_context {
struct db_context *db_recursive;
@@ -137,11 +138,17 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server,
bool notify_internal_parent_init(TALLOC_CTX *mem_ctx)
{
struct tdb_wrap *db1, *db2;
+ struct loadparm_context *lp_ctx;
if (lp_clustering()) {
return true;
}
+ lp_ctx = loadparm_init_s3(mem_ctx, loadparm_s3_context());
+ if (lp_ctx == NULL) {
+ DEBUG(0, ("loadparm_init_s3 failed\n"));
+ return false;
+ }
/*
* Open the tdbs in the parent process (smbd) so that our
* CLEAR_IF_FIRST optimization in tdb_reopen_all can properly
@@ -150,13 +157,15 @@ bool notify_internal_parent_init(TALLOC_CTX *mem_ctx)
db1 = tdb_wrap_open(mem_ctx, lock_path("notify.tdb"),
0, TDB_SEQNUM|TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH,
- O_RDWR|O_CREAT, 0644);
+ O_RDWR|O_CREAT, 0644, lp_ctx);
if (db1 == NULL) {
+ talloc_unlink(mem_ctx, lp_ctx);
DEBUG(1, ("could not open notify.tdb: %s\n", strerror(errno)));
return false;
}
db2 = tdb_wrap_open(mem_ctx, lock_path("notify_onelevel.tdb"),
- 0, TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, O_RDWR|O_CREAT, 0644);
+ 0, TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, O_RDWR|O_CREAT, 0644, lp_ctx);
+ talloc_unlink(mem_ctx, lp_ctx);
if (db2 == NULL) {
DEBUG(1, ("could not open notify_onelevel.tdb: %s\n",
strerror(errno)));