From: Volker Lendecke Date: Tue, 25 Sep 2018 15:59:20 +0000 (-0700) Subject: lib: Remove unused tdb_trans_* functions X-Git-Tag: tdb-1.3.17~1137 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94f8a690f66718f14e3bddab40215d1d4ce72cfb;p=thirdparty%2Fsamba.git lib: Remove unused tdb_trans_* functions The transactions have all moved to dbwrap Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/include/util_tdb.h b/source3/include/util_tdb.h index 8dc104834e8..d4efb0c31aa 100644 --- a/source3/include/util_tdb.h +++ b/source3/include/util_tdb.h @@ -26,12 +26,6 @@ #include "../libcli/util/ntstatus.h" /* for map_nt_error_from_tdb() */ #include "../../lib/util/util_tdb.h" -int tdb_trans_store_bystring(TDB_CONTEXT *tdb, const char *keystr, - TDB_DATA data, int flags); -int tdb_trans_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, - int flag); -int tdb_trans_delete(struct tdb_context *tdb, TDB_DATA key); - /* * The tdb_unpack() and tdb_pack[_append]() helpers are deprecated. Consider * using idl/ndr for marshalling of complex data types instead. diff --git a/source3/lib/util_tdb.c b/source3/lib/util_tdb.c index 9730a030c10..cbcca4df09f 100644 --- a/source3/lib/util_tdb.c +++ b/source3/lib/util_tdb.c @@ -29,17 +29,6 @@ #undef calloc #undef strdup -/* these are little tdb utility functions that are meant to make - dealing with a tdb database a little less cumbersome in Samba */ - -int tdb_trans_store_bystring(TDB_CONTEXT *tdb, const char *keystr, - TDB_DATA data, int flags) -{ - TDB_DATA key = string_term_tdb_data(keystr); - - return tdb_trans_store(tdb, key, data, flags); -} - /**************************************************************************** Useful pair of routines for packing/unpacking data consisting of integers and strings. @@ -319,61 +308,6 @@ TDB_CONTEXT *tdb_open_log(const char *name, int hash_size, int tdb_flags, return tdb; } -/**************************************************************************** - tdb_store, wrapped in a transaction. This way we make sure that a process - that dies within writing does not leave a corrupt tdb behind. -****************************************************************************/ - -int tdb_trans_store(struct tdb_context *tdb, TDB_DATA key, TDB_DATA dbuf, - int flag) -{ - int res; - - if ((res = tdb_transaction_start(tdb)) != 0) { - DEBUG(5, ("tdb_transaction_start failed\n")); - return res; - } - - if ((res = tdb_store(tdb, key, dbuf, flag)) != 0) { - DEBUG(10, ("tdb_store failed\n")); - tdb_transaction_cancel(tdb); - return res; - } - - if ((res = tdb_transaction_commit(tdb)) != 0) { - DEBUG(5, ("tdb_transaction_commit failed\n")); - } - - return res; -} - -/**************************************************************************** - tdb_delete, wrapped in a transaction. This way we make sure that a process - that dies within deleting does not leave a corrupt tdb behind. -****************************************************************************/ - -int tdb_trans_delete(struct tdb_context *tdb, TDB_DATA key) -{ - int res; - - if ((res = tdb_transaction_start(tdb)) != 0) { - DEBUG(5, ("tdb_transaction_start failed\n")); - return res; - } - - if ((res = tdb_delete(tdb, key)) != 0) { - DEBUG(10, ("tdb_delete failed\n")); - tdb_transaction_cancel(tdb); - return res; - } - - if ((res = tdb_transaction_commit(tdb)) != 0) { - DEBUG(5, ("tdb_transaction_commit failed\n")); - } - - return res; -} - int tdb_data_cmp(TDB_DATA t1, TDB_DATA t2) { int ret;