diff options
author | Volker Lendecke <vl@samba.org> | 2015-09-21 12:28:20 +0200 |
---|---|---|
committer | Ralph Böhme <slow@samba.org> | 2015-09-22 04:51:16 +0200 |
commit | 5d12eb890880c4d7e23a266f6817e40636fc81e6 (patch) | |
tree | 2adb48ebc6f1e814119c34ede30df4daf7630077 /lib/dbwrap | |
parent | 1399198d51d1f79ff99304369442e04c015eef23 (diff) | |
download | samba-5d12eb890880c4d7e23a266f6817e40636fc81e6.tar.gz |
dbwrap: Remove loadparm_context from db_open_tdb
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'lib/dbwrap')
-rw-r--r-- | lib/dbwrap/dbwrap_local_open.c | 9 | ||||
-rw-r--r-- | lib/dbwrap/dbwrap_tdb.c | 8 | ||||
-rw-r--r-- | lib/dbwrap/dbwrap_tdb.h | 1 |
3 files changed, 8 insertions, 10 deletions
diff --git a/lib/dbwrap/dbwrap_local_open.c b/lib/dbwrap/dbwrap_local_open.c index 6509ff97871..c350fd3ea42 100644 --- a/lib/dbwrap/dbwrap_local_open.c +++ b/lib/dbwrap/dbwrap_local_open.c @@ -34,8 +34,13 @@ struct db_context *dbwrap_local_open(TALLOC_CTX *mem_ctx, { struct db_context *db = NULL; - db = db_open_tdb(mem_ctx, lp_ctx, name, hash_size, - tdb_flags, open_flags, mode, + if (hash_size == 0) { + hash_size = lpcfg_tdb_hash_size(lp_ctx, name); + } + + db = db_open_tdb(mem_ctx, name, hash_size, + lpcfg_tdb_flags(lp_ctx, tdb_flags), + open_flags, mode, lock_order, dbwrap_flags); return db; diff --git a/lib/dbwrap/dbwrap_tdb.c b/lib/dbwrap/dbwrap_tdb.c index 2bc123e36d3..574b5d93d47 100644 --- a/lib/dbwrap/dbwrap_tdb.c +++ b/lib/dbwrap/dbwrap_tdb.c @@ -397,7 +397,6 @@ static void db_tdb_id(struct db_context *db, const uint8_t **id, size_t *idlen) } struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx, - struct loadparm_context *lp_ctx, const char *name, int hash_size, int tdb_flags, int open_flags, mode_t mode, @@ -421,12 +420,7 @@ struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx, } result->lock_order = lock_order; - if (hash_size == 0) { - hash_size = lpcfg_tdb_hash_size(lp_ctx, name); - } - - db_tdb->wtdb = tdb_wrap_open(db_tdb, name, hash_size, - lpcfg_tdb_flags(lp_ctx, tdb_flags), + db_tdb->wtdb = tdb_wrap_open(db_tdb, name, hash_size, tdb_flags, open_flags, mode); if (db_tdb->wtdb == NULL) { DEBUG(3, ("Could not open tdb: %s\n", strerror(errno))); diff --git a/lib/dbwrap/dbwrap_tdb.h b/lib/dbwrap/dbwrap_tdb.h index 93ee09c6057..d5f49c7d574 100644 --- a/lib/dbwrap/dbwrap_tdb.h +++ b/lib/dbwrap/dbwrap_tdb.h @@ -25,7 +25,6 @@ struct db_context; struct db_context *db_open_tdb(TALLOC_CTX *mem_ctx, - struct loadparm_context *lp_ctx, const char *name, int hash_size, int tdb_flags, int open_flags, mode_t mode, |