lib: Remove unused tdb_trans_* functions
authorVolker Lendecke <vl@samba.org>
Tue, 25 Sep 2018 15:59:20 +0000 (08:59 -0700)
committerVolker Lendecke <vl@samba.org>
Sat, 27 Oct 2018 19:24:24 +0000 (21:24 +0200)
The transactions have all moved to dbwrap

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/include/util_tdb.h
source3/lib/util_tdb.c

index 8dc104834e853192fe9b16943b65819fae08969c..d4efb0c31aa25c1fd1674aacd21ab5d50f40c69c 100644 (file)
 #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.
index 9730a030c10c6df71c33cdf5841eeff1bc3116f1..cbcca4df09fc05e2ce54b0ba68f3ba12ef35ace3 100644 (file)
 #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;