From 527dc2ed52c78b1ae114207736883759638db5d1 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 8 Dec 2011 13:56:07 +0100 Subject: s3-dbwrap: Make dbwrap_fallback_fetch private --- source3/lib/dbwrap/dbwrap.c | 9 ++++++--- source3/lib/dbwrap/dbwrap_open.c | 3 --- source3/lib/dbwrap/dbwrap_private.h | 4 ---- 3 files changed, 6 insertions(+), 10 deletions(-) (limited to 'source3') diff --git a/source3/lib/dbwrap/dbwrap.c b/source3/lib/dbwrap/dbwrap.c index adda8e6060e..1232b7991f2 100644 --- a/source3/lib/dbwrap/dbwrap.c +++ b/source3/lib/dbwrap/dbwrap.c @@ -28,8 +28,9 @@ * Fall back using fetch_locked if no genuine fetch operation is provided */ -NTSTATUS dbwrap_fallback_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, - TDB_DATA key, TDB_DATA *data) +static NTSTATUS dbwrap_fallback_fetch(struct db_context *db, + TALLOC_CTX *mem_ctx, + TDB_DATA key, TDB_DATA *data) { struct db_record *rec; @@ -133,7 +134,9 @@ NTSTATUS dbwrap_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, if (value == NULL) { return NT_STATUS_INVALID_PARAMETER; } - + if (db->fetch == NULL) { + return dbwrap_fallback_fetch(db, mem_ctx, key, value); + } return db->fetch(db, mem_ctx, key, value); } diff --git a/source3/lib/dbwrap/dbwrap_open.c b/source3/lib/dbwrap/dbwrap_open.c index 47cc5a769e0..bc2dbab449e 100644 --- a/source3/lib/dbwrap/dbwrap_open.c +++ b/source3/lib/dbwrap/dbwrap_open.c @@ -110,9 +110,6 @@ struct db_context *db_open(TALLOC_CTX *mem_ctx, tdb_flags, open_flags, mode); } - if ((result != NULL) && (result->fetch == NULL)) { - result->fetch = dbwrap_fallback_fetch; - } if ((result != NULL) && (result->parse_record == NULL)) { result->parse_record = dbwrap_fallback_parse_record; } diff --git a/source3/lib/dbwrap/dbwrap_private.h b/source3/lib/dbwrap/dbwrap_private.h index e7bd480cbba..5a7ca335139 100644 --- a/source3/lib/dbwrap/dbwrap_private.h +++ b/source3/lib/dbwrap/dbwrap_private.h @@ -59,10 +59,6 @@ struct db_context { bool persistent; }; -NTSTATUS dbwrap_fallback_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, - TDB_DATA key, TDB_DATA *data); - - int dbwrap_fallback_parse_record(struct db_context *db, TDB_DATA key, int (*parser)(TDB_DATA key, TDB_DATA data, -- cgit