From 663c661b11396076a079a99d1f66fafb732af1d8 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 17 Aug 2011 08:38:39 +0200 Subject: s3:dbwrap: move dbwrap_store() back to dbwrap.c, the core of the dbwrap subsystem --- source3/lib/dbwrap/dbwrap.c | 16 ++++++++++++++++ source3/lib/dbwrap/dbwrap_util.c | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/dbwrap/dbwrap.c b/source3/lib/dbwrap/dbwrap.c index 5054316271..e9baa13c1b 100644 --- a/source3/lib/dbwrap/dbwrap.c +++ b/source3/lib/dbwrap/dbwrap.c @@ -79,6 +79,22 @@ TDB_DATA dbwrap_fetch(struct db_context *db, TALLOC_CTX *mem_ctx, return result; } +NTSTATUS dbwrap_store(struct db_context *db, TDB_DATA key, + TDB_DATA data, int flags) +{ + struct db_record *rec; + NTSTATUS status; + + rec = db->fetch_locked(db, talloc_tos(), key); + if (rec == NULL) { + return NT_STATUS_NO_MEMORY; + } + + status = rec->store(rec, data, flags); + TALLOC_FREE(rec); + return status; +} + NTSTATUS dbwrap_delete(struct db_context *db, TDB_DATA key) { struct db_record *rec; diff --git a/source3/lib/dbwrap/dbwrap_util.c b/source3/lib/dbwrap/dbwrap_util.c index 1216e2e25f..9ca781caf2 100644 --- a/source3/lib/dbwrap/dbwrap_util.c +++ b/source3/lib/dbwrap/dbwrap_util.c @@ -456,22 +456,6 @@ NTSTATUS dbwrap_traverse(struct db_context *db, } -NTSTATUS dbwrap_store(struct db_context *db, TDB_DATA key, - TDB_DATA data, int flags) -{ - struct db_record *rec; - NTSTATUS status; - - rec = db->fetch_locked(db, talloc_tos(), key); - if (rec == NULL) { - return NT_STATUS_NO_MEMORY; - } - - status = rec->store(rec, data, flags); - TALLOC_FREE(rec); - return status; -} - NTSTATUS dbwrap_delete_bystring(struct db_context *db, const char *key) { return dbwrap_delete(db, string_term_tdb_data(key)); -- cgit