s3:dbwrap: move dbwrap_fetch() back to dbwrap.c, the core of the dbwrap subsystem
authorMichael Adam <obnox@samba.org>
Wed, 17 Aug 2011 06:35:21 +0000 (08:35 +0200)
committerMichael Adam <obnox@samba.org>
Tue, 11 Oct 2011 12:17:55 +0000 (14:17 +0200)
source3/lib/dbwrap/dbwrap.c
source3/lib/dbwrap/dbwrap_util.c

index 6a6d4c64e5732b666cc819d6e3677e55278c96eb..5b87fd3154e4535b0ec939dc28bebb76f5fbdb0a 100644 (file)
@@ -22,6 +22,7 @@
 #include "includes.h"
 #include "dbwrap/dbwrap.h"
 #include "dbwrap/dbwrap_private.h"
+#include "util_tdb.h"
 
 /*
  * Fall back using fetch_locked if no genuine fetch operation is provided
@@ -64,3 +65,16 @@ int dbwrap_fallback_parse_record(struct db_context *db, TDB_DATA key,
        TALLOC_FREE(data.dptr);
        return res;
 }
+
+
+TDB_DATA dbwrap_fetch(struct db_context *db, TALLOC_CTX *mem_ctx,
+                     TDB_DATA key)
+{
+       TDB_DATA result;
+
+       if (db->fetch(db, mem_ctx, key, &result) != 0) {
+               return make_tdb_data(NULL, 0);
+       }
+
+       return result;
+}
index effcf40c6b3737da5e8135f92837dca528fcbd0c..a950d514040b86af98166b11ee03823b9e37dc4d 100644 (file)
@@ -487,18 +487,6 @@ NTSTATUS dbwrap_store(struct db_context *db, TDB_DATA key,
        return status;
 }
 
-TDB_DATA dbwrap_fetch(struct db_context *db, TALLOC_CTX *mem_ctx,
-                     TDB_DATA key)
-{
-       TDB_DATA result;
-
-       if (db->fetch(db, mem_ctx, key, &result) != 0) {
-               return make_tdb_data(NULL, 0);
-       }
-
-       return result;
-}
-
 NTSTATUS dbwrap_delete_bystring(struct db_context *db, const char *key)
 {
        return dbwrap_delete(db, string_term_tdb_data(key));